[et-mgmt-tools] [PATCH]Check the starting domain's uuid

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

 



Hi

The virt-install command has a problem that the information of
the existent domain is overwritten by virt-install command
specifing the domain's uuid.
Futhermore, the existent domain's set-up file is overwritten
on the xen-3.0.4.

I make a patch checking the starting domain's uuid on Guest.py.

Signed-off-by: Tatsuro Enokura <fj1826dm@xxxxxxxxxxxxxxxxx>

Thanks,
Tatsuro Enokura

=======================================================================
diff -r 1776ef836bf6 virtinst/Guest.py
--- a/virtinst/Guest.py Wed Feb 28 07:47:31 2007 -0500
+++ b/virtinst/Guest.py Fri Mar 02 00:07:29 2007 +0900
@@ -554,7 +554,19 @@ class Guest(object):

     def _set_defaults(self):
         if self.uuid is None:
-            self.uuid = util.uuidToString(util.randomUUID())
+            while 1:
+                self.uuid = util.uuidToString(util.randomUUID())
+                try:
+                    if self.conn.lookupByUUIDString(self.uuid) is not None:
+                        continue
+                except libvirt.libvirtError:
+                    break
+        else:
+            try:
+                if self.conn.lookupByUUIDString(self.uuid) is not None:
+                    raise RuntimeError, "UUID must be specified for all
guests!"
+            except libvirt.libvirtError:
+                pass
         if self.vcpus is None:
             self.vcpus = 1
         if self.name is None or self.memory is None:
=======================================================================


[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