Skip to contentSkip to conversation

Fix 'xm reboot'

PATCH New Jim Fehlig 1 participant 1 message Sep 13, 2007

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

PATCH 1/1 Fix 'xm reboot'

I noticed a winxp guest did not restart after performing a file system check. Didn't think much about it until finding the following in xend.log sometime later

[2007-09-12 11:27:20 21028] ERROR (XendDomainInfo:1324) Failed to restart domain 3.
Traceback (most recent call last):
File "/usr/lib64/python2.5/site-packages/xen/xend/XendDomainInfo.py",
line 1309, in _restart
self.info)
File "/usr/lib64/python2.5/site-packages/xen/xend/XendDomain.py", line
933, in domain_create_from_dict
dominfo = XendDomainInfo.create_from_dict(config_dict)
File "/usr/lib64/python2.5/site-packages/xen/xend/XendDomainInfo.py",
line 101, in create_from_dict
vm = XendDomainInfo(XendConfig.XendConfig(xapi = config_dict))
File "/usr/lib64/python2.5/site-packages/xen/xend/XendDomainInfo.py",
line 377, in __init__
self._checkName(self.info['name_label'])
File "/usr/lib64/python2.5/site-packages/xen/xend/XendDomainInfo.py",
line 2172, in _checkName

    (" as domain %s" % str(dom.domid)) or ""))

VmError: VM name 'sles10_pv_64' already exists

Got the same result with 'xm reboot' on PV guest. Attached is a patch that fixes this problem but not quite certain if this is most appropriate place for fix. dom.domid is certainly None -- it is set to None in XendDomainInfo.cleanupDomain(). Tested save/restore/migrate/reboot and observed no regressions.

Regards,
Jim

tools/python/xen/xend/XendDomainInfo.py +1 -1
diff -r a00cc97b392a tools/python/xen/xend/XendDomainInfo.py
@@ -2167,7 +2167,7 @@ class XendDomainInfo:
             raise VmError('Invalid VM Name')
 
         dom =  XendDomain.instance().domain_lookup_nr(name)
-        if dom and dom.domid != self.domid:
+        if dom and dom.domid and dom.domid != self.domid:
             raise VmError("VM name '%s' already exists%s" %
                           (name,
                            dom.domid is not None and

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel