[virt-tools-list] [virt-manager PATCH] virt-clone: remove socket path for unix channel

Pavel Hrdina phrdina at redhat.com
Mon Nov 2 12:34:59 UTC 2015


Libvirt automatically generates this path with a guest name used as
directory.  The new conception is to have all sockets for one guest in
it's own directory and in order to successfully clone a guest, we need
to remove this path to regenerate it with new guest name.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1270696

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 virtinst/cloner.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/virtinst/cloner.py b/virtinst/cloner.py
index 12716b6..468e559 100644
--- a/virtinst/cloner.py
+++ b/virtinst/cloner.py
@@ -30,6 +30,7 @@ from .guest import Guest
 from .deviceinterface import VirtualNetworkInterface
 from .devicedisk import VirtualDisk
 from .storage import StorageVolume
+from .devicechar import VirtualChannelDevice
 
 
 class Cloner(object):
@@ -413,6 +414,12 @@ class Cloner(object):
             xmldisk.driver_type = orig_disk.driver_type
             xmldisk.path = clone_disk.path
 
+        # For guest agent channel, remove a path to generate a new one with
+        # new guest name
+        for channel in self._guest.get_devices("channel"):
+            if channel.type == VirtualChannelDevice.TYPE_UNIX:
+                channel._source_path = None
+
         # Save altered clone xml
         self._clone_xml = self._guest.get_xml_config()
         logging.debug("Clone guest xml is\n%s", self._clone_xml)
-- 
2.6.2




More information about the virt-tools-list mailing list