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

[virt-tools-list] [PATCH v3] virt-clone:update the VNC handling information when cloning

Hi Cole,
Thanks for your good suggestions, I verified that this patch works
for multi graphics devices, too.

Wanlong Gao

From: Wanlong Gao <gaowanlong cn fujitsu com>
Assume you set port='5900' and no autoport.
Then, copied guest's vnc will have the same port with the orignal.
If one of them started, another can't get vnc.

So, if you find 'port=xxxx' in the orignal xml, you should modify it as autoport
with some warning. Then, you can run both of guests at once.

Suggested-by: KAMEZAWA Hiroyuki <kamezawa hiroyu jp fujitsu com>
Signed-off-by: Wanlong Gao <gaowanlong cn fujitsu com>
 virtinst/CloneManager.py |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/virtinst/CloneManager.py b/virtinst/CloneManager.py
index ff3c074..7108867 100644
--- a/virtinst/CloneManager.py
+++ b/virtinst/CloneManager.py
@@ -441,6 +441,11 @@ class CloneDesign(object):
         self._guest.name = self._clone_name
         self._guest.uuid = self._clone_uuid
+        for dev in self._guest.get_devices("graphics"):
+            if dev.port and dev.port != -1:
+                logging.warn(_("Setting the graphics device port to autoport, "
+                               "in order to avoid conflicting."))
+                dev.port = -1
         for iface in self._guest.get_devices("interface"):
             iface.target_dev = None

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