ia64/xen-unstable

changeset 12715:fbfbc6ed47d9

Fix managed domain rebooting by only complaining about a VM name conflict if
the VM UUID conflicts as well.

Also, remove the previous_restart_time node when explicitly rebooting a guest --
the user ought to be able to drive reboots faster than the safety catch.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Thu Nov 30 20:07:58 2006 +0000 (2006-11-30)
parents 2e5291248789
children 952c2cddff0c
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Nov 30 19:11:51 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Nov 30 20:07:58 2006 +0000
     1.3 @@ -479,8 +479,9 @@ class XendDomainInfo:
     1.4          
     1.5          if reason not in DOMAIN_SHUTDOWN_REASONS.values():
     1.6              raise XendError('Invalid reason: %s' % reason)
     1.7 +        self._removeVm('xend/previous_restart_time')
     1.8          self.storeDom("control/shutdown", reason)
     1.9 -                
    1.10 +
    1.11      def pause(self):
    1.12          """Pause domain
    1.13          
    1.14 @@ -1692,8 +1693,9 @@ class XendDomainInfo:
    1.15              raise VmError('Invalid VM Name')
    1.16  
    1.17          dom =  XendDomain.instance().domain_lookup_nr(name)
    1.18 -        if dom and dom != self and not dom.info['dying']:
    1.19 -            raise VmError("VM name '%s' already exists" % name)
    1.20 +        if dom and dom.info['uuid'] != self.info['uuid']:
    1.21 +            raise VmError("VM name '%s' already exists as domain %s" %
    1.22 +                          (name, str(dom.domid)))
    1.23          
    1.24  
    1.25      def update(self, info = None, refresh = True):