Re: [PATCH]: virt-manager: start network before vm creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 02, 2008 at 09:48:09AM -0400, Cole Robinson wrote:
> Looks like you forgot to attach it :)
Attached now. Sorry.
 -- Guido
# HG changeset patch
# User "Guido Günther <agx@xxxxxxxxxxx>"
# Date 1222953353 -7200
# Node ID 4fd6f98665254b623268f6019ec6ffb72189e82f
# Parent  c94fe88e5f64d9273a789b0fa4a4c278ff289777
allow to activate inactive networks

diff -r c94fe88e5f64 -r 4fd6f9866525 src/virtManager/create.py
--- a/src/virtManager/create.py	Tue Sep 30 11:37:52 2008 -0400
+++ b/src/virtManager/create.py	Thu Oct 02 15:15:53 2008 +0200
@@ -1066,6 +1066,18 @@
             except ValueError, e:
                 return self.err.val_err(_("Network Parameter Error"), str(e))
 
+            if self._net.type == "network":
+                if self._net.network not in self.connection.vmm.listNetworks():
+                    res = self.err.yes_no(_("Network inactive"),
+                                          _("Network '%s' is not active. Start the network?") % 
+                                          self._net.network)
+                    if res:
+                        net = self.connection.vmm.networkLookupByName(self._net.network)
+                        net.create()
+                        logging.info("Started network '%s'." % self._net.network)
+                    else:
+                        return False
+
             conflict = self._net.is_conflict_net(self._guest.conn)
             if conflict[0]:
                 return self.err.val_err(_("Mac address collision"), conflict[1])
@@ -1124,7 +1136,10 @@
         model.clear()
         for uuid in self.connection.list_net_uuids():
             net = self.connection.get_net(uuid)
-            model.append([net.get_label(), net.get_name()])
+            if net.get_name() in self.connection.vmm.listNetworks():
+                model.append([net.get_label(), net.get_name()])
+            else:
+                model.append([net.get_label(), "%s (%s)" % (net.get_name(), _("Inactive"))])
 
     def populate_device_model(self, model):
         model.clear()
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux