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

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

 



Hi,
currently we don't check if a network is already running, when trying to
create a new machine in virt-manager. Attached patch starts the network
if it's not running instead of throwing an exception at the user,
adresses a Debian bug [1].
Cheers,
 -- Guido

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499867
# HG changeset patch
# User "Guido Günther <agx@xxxxxxxxxxx>"
# Date 1222337938 -7200
# Node ID 64d05c7c56936dec8b2cf9a432a0b0b429934a15
# Parent  a75744bddfe48b97a6c43d280a36c4bfb0160cbc
start network if necessary

diff -r a75744bddfe4 -r 64d05c7c5693 src/virtManager/create.py
--- a/src/virtManager/create.py	Thu Sep 25 11:30:03 2008 +0200
+++ b/src/virtManager/create.py	Thu Sep 25 12:18:58 2008 +0200
@@ -626,6 +626,12 @@
                 self._net = virtinst.VirtualNetworkInterface(type="user")
             except ValueError, e:
                 return self.err.val_err(_("Failed to set up usermode networking"), str(e))
+
+        if self._net.type == "network":
+            if self._net.network not in self.connection.vmm.listNetworks():
+                net = self.connection.vmm.networkLookupByName(self._net.network)
+                net.create()
+                logging.info("Startet network '%s'." % self._net.network)
 
         if self._disk is not None:
             guest.disks = [self._disk]
_______________________________________________
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