ia64/xen-unstable

changeset 10730:b20580cf7fc1

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@xensource.com>
author kfraser@localhost.localdomain
date Wed Jul 12 16:34:39 2006 +0100 (2006-07-12)
parents 84ff152efb0a
children bd68ce5a3f0c
files tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Jul 12 11:58:40 2006 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed Jul 12 16:34:39 2006 +0100
     1.3 @@ -347,19 +347,6 @@ class XendDomain:
     1.4              self.domains_lock.release()
     1.5  
     1.6  
     1.7 -    def domain_lookup_by_uuid_nr(self, uuid):
     1.8 -        self.domains_lock.acquire()
     1.9 -        try:
    1.10 -            matching = filter(lambda d: d.getUuid() == uuid,
    1.11 -                              self.domains.values())
    1.12 -            n = len(matching)
    1.13 -            if n == 1:
    1.14 -                return matching[0]
    1.15 -            return None
    1.16 -        finally:
    1.17 -            self.domains_lock.release()
    1.18 -
    1.19 -
    1.20      def privilegedDomain(self):
    1.21          self.domains_lock.acquire()
    1.22          try:
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Jul 12 11:58:40 2006 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Jul 12 16:34:39 2006 +0100
     2.3 @@ -396,10 +396,6 @@ def domain_by_name(name):
     2.4      return XendDomain.instance().domain_lookup_by_name_nr(name)
     2.5  
     2.6  
     2.7 -def domain_by_uuid(uuid):
     2.8 -    return XendDomain.instance().domain_lookup_by_uuid_nr(uuid)
     2.9 -
    2.10 -
    2.11  def shutdown_reason(code):
    2.12      """Get a shutdown reason from a code.
    2.13  
    2.14 @@ -585,7 +581,6 @@ class XendDomainInfo:
    2.15              defaultInfo('security',     lambda: None)
    2.16  
    2.17              self.check_name(self.info['name'])
    2.18 -            self.check_uuid(self.info['uuid'])
    2.19  
    2.20              if isinstance(self.info['image'], str):
    2.21                  self.info['image'] = sxp.from_string(self.info['image'])
    2.22 @@ -783,9 +778,6 @@ class XendDomainInfo:
    2.23      def getName(self):
    2.24          return self.info['name']
    2.25  
    2.26 -    def getUuid(self):
    2.27 -        return self.info['uuid']
    2.28 -
    2.29      def getDomainPath(self):
    2.30          return self.dompath
    2.31  
    2.32 @@ -1215,23 +1207,6 @@ class XendDomainInfo:
    2.33                            (name, self.domid, dominfo.domid))
    2.34  
    2.35  
    2.36 -    def check_uuid(self, uuid):
    2.37 -        """The same uuid cannot be used for more than one vm at the same time.
    2.38 -
    2.39 -        @param uuid: uuid
    2.40 -        @raise: VmError if same uuid is used
    2.41 -        """
    2.42 -        dominfo = domain_by_uuid(uuid)
    2.43 -        if not dominfo:
    2.44 -            return
    2.45 -        if self.domid is None:
    2.46 -            raise VmError("uuid '%s' already in use by domain %d" %
    2.47 -                          (uuid, dominfo.domid))
    2.48 -        if dominfo.domid != self.domid:
    2.49 -            raise VmError("uuid '%s' is used in both domains %d and %d" %
    2.50 -                          (uuid, self.domid, dominfo.domid))
    2.51 -
    2.52 -
    2.53      def construct(self):
    2.54          """Construct the domain.
    2.55