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

[Xen-changelog] [xen-unstable] Revert c/s 10651: "prevent double uuid use". Breaks localhost



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID b20580cf7fc1bfe5119597bb5b576cdd020551d5
# Parent  84ff152efb0aa9252df4dccd4e9e539569f9f55d
Revert c/s 10651: "prevent double uuid use". Breaks localhost
migration, since old and new domains can coexist at same time
with same uuid.

Possibly this patch could be accepted if xend were to be able to
deal with localhost migration (and save/restore, which can also
occasionally race).

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomain.py     |   13 -------------
 tools/python/xen/xend/XendDomainInfo.py |   25 -------------------------
 2 files changed, 38 deletions(-)

diff -r 84ff152efb0a -r b20580cf7fc1 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Jul 12 11:58:40 2006 +0100
+++ b/tools/python/xen/xend/XendDomain.py       Wed Jul 12 16:34:39 2006 +0100
@@ -347,19 +347,6 @@ class XendDomain:
             self.domains_lock.release()
 
 
-    def domain_lookup_by_uuid_nr(self, uuid):
-        self.domains_lock.acquire()
-        try:
-            matching = filter(lambda d: d.getUuid() == uuid,
-                              self.domains.values())
-            n = len(matching)
-            if n == 1:
-                return matching[0]
-            return None
-        finally:
-            self.domains_lock.release()
-
-
     def privilegedDomain(self):
         self.domains_lock.acquire()
         try:
diff -r 84ff152efb0a -r b20580cf7fc1 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Jul 12 11:58:40 2006 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Jul 12 16:34:39 2006 +0100
@@ -396,10 +396,6 @@ def domain_by_name(name):
     return XendDomain.instance().domain_lookup_by_name_nr(name)
 
 
-def domain_by_uuid(uuid):
-    return XendDomain.instance().domain_lookup_by_uuid_nr(uuid)
-
-
 def shutdown_reason(code):
     """Get a shutdown reason from a code.
 
@@ -585,7 +581,6 @@ class XendDomainInfo:
             defaultInfo('security',     lambda: None)
 
             self.check_name(self.info['name'])
-            self.check_uuid(self.info['uuid'])
 
             if isinstance(self.info['image'], str):
                 self.info['image'] = sxp.from_string(self.info['image'])
@@ -782,9 +777,6 @@ class XendDomainInfo:
 
     def getName(self):
         return self.info['name']
-
-    def getUuid(self):
-        return self.info['uuid']
 
     def getDomainPath(self):
         return self.dompath
@@ -1213,23 +1205,6 @@ class XendDomainInfo:
         if dominfo.domid != self.domid:
             raise VmError("VM name '%s' is used in both domains %d and %d" %
                           (name, self.domid, dominfo.domid))
-
-
-    def check_uuid(self, uuid):
-        """The same uuid cannot be used for more than one vm at the same time.
-
-        @param uuid: uuid
-        @raise: VmError if same uuid is used
-        """
-        dominfo = domain_by_uuid(uuid)
-        if not dominfo:
-            return
-        if self.domid is None:
-            raise VmError("uuid '%s' already in use by domain %d" %
-                          (uuid, dominfo.domid))
-        if dominfo.domid != self.domid:
-            raise VmError("uuid '%s' is used in both domains %d and %d" %
-                          (uuid, self.domid, dominfo.domid))
 
 
     def construct(self):

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.