ia64/xen-unstable

changeset 15997:8817a53c030f

xend: Fix name uniqueness check (revert 15168:a717cb2fac90).

Changeset 15168:a717cb2fac90 altered check_name() in XendDomainInfo so
that it compares domain IDs instead of UUIDs. This breaks a number of
things

- You can no longer use 'xm new' to define a persistent config file for
a running guest. This breaks the key OS provisioning scenario where
you boot a kenrel+initrd for the installer, and at the same time
define a permanent config with pygrub.

- It lets you define multiple inactive guests with different UUIDs, but
the same name because all inactive guests have a domid of None. So
you can now end up with multiple guests with same name, which is
contrary to the goal implied by the patch which was name uniqueness.

It is unclear from the original commit logs just what scenario it was
trying to protect against, but the original checking of uniqueness
based on UUID was correct & is what was used in previous releases XenD.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
author Keir Fraser <keir@xensource.com>
date Thu Sep 27 18:08:11 2007 +0100 (2007-09-27)
parents 3a799196ff69
children ee498c9af856 b4c8cd753b88
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Sep 27 17:44:03 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Sep 27 18:08:11 2007 +0100
     1.3 @@ -2184,7 +2184,7 @@ class XendDomainInfo:
     1.4              raise VmError('Invalid VM Name')
     1.5  
     1.6          dom =  XendDomain.instance().domain_lookup_nr(name)
     1.7 -        if dom and dom.domid and dom.domid != self.domid:
     1.8 +        if dom and dom.info['uuid'] != self.info['uuid']:
     1.9              raise VmError("VM name '%s' already exists%s" %
    1.10                            (name,
    1.11                             dom.domid is not None and