From: Wim Colgate Date: Wed, 14 Feb 2007 20:18:32 +0000 (-0800) Subject: Protect self.domid from being empty X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15318^2~56 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c25f8d6b9392f9d920b91b2b6cab5cb46eb26130;p=xen.git Protect self.domid from being empty --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 6c4a9afcb4..615efbd56a 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1569,16 +1569,17 @@ class XendDomainInfo: # get associated devices to destroy # build list of phantom devices to be removed after normal devices plist = [] - from xen.xend.xenstore.xstransact import xstransact - t = xstransact("%s/device/vbd" % GetDomainPath(self.domid)) - for dev in t.list(): - backend_phantom_vbd = xstransact.Read("%s/device/vbd/%s/phantom_vbd" \ - % (self.dompath, dev)) - if backend_phantom_vbd is not None: - frontend_phantom_vbd = xstransact.Read("%s/frontend" \ - % backend_phantom_vbd) - plist.append(backend_phantom_vbd) - plist.append(frontend_phantom_vbd) + if self.domid is not None: + from xen.xend.xenstore.xstransact import xstransact + t = xstransact("%s/device/vbd" % GetDomainPath(self.domid)) + for dev in t.list(): + backend_phantom_vbd = xstransact.Read("%s/device/vbd/%s/phantom_vbd" \ + % (self.dompath, dev)) + if backend_phantom_vbd is not None: + frontend_phantom_vbd = xstransact.Read("%s/frontend" \ + % backend_phantom_vbd) + plist.append(backend_phantom_vbd) + plist.append(frontend_phantom_vbd) return plist def _cleanup_phantom_devs(self, plist):