diff options
-rw-r--r-- | stubdom/stubdom-dm | 8 | ||||
-rw-r--r-- | tools/python/xen/xend/XendDomainInfo.py | 18 | ||||
-rw-r--r-- | tools/python/xen/xend/image.py | 6 |
3 files changed, 19 insertions, 13 deletions
diff --git a/stubdom/stubdom-dm b/stubdom/stubdom-dm index b76dab278b..bf77d1fad1 100644 --- a/stubdom/stubdom-dm +++ b/stubdom/stubdom-dm @@ -81,12 +81,8 @@ done term() { kill %1 - ( - [ -n "$vncpid" ] && kill -9 $vncpid - rm ${stubdom_configdir}/$domname-dm - xm destroy $domname-dm - ) & - # We need to exit immediately so as to let xend do the commands above + [ -n "$vncpid" ] && kill -9 $vncpid + rm ${stubdom_configdir}/$domname-dm exit 0 } diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 5e9f0fe6e1..724c50951e 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -855,12 +855,10 @@ class XendDomainInfo: dev_config = pci_convert_sxp_to_dict(dev_sxp) dev = dev_config['devs'][0] - dom_list = xstransact.List('/local/domain') - for d in dom_list: - target = xstransact.Read('/local/domain/' + d + '/target') - if target is not None and int(target) is self.domid : - from xen.xend import XendDomain - XendDomain.instance().domain_lookup(int(d)).pci_device_configure(dev_sxp[:]) + stubdomid = self.getStubdomDomid() + if stubdomid is not None : + from xen.xend import XendDomain + XendDomain.instance().domain_lookup(stubdomid).pci_device_configure(dev_sxp[:]) # Do HVM specific processing if self.info.is_hvm(): @@ -1810,6 +1808,14 @@ class XendDomainInfo: def getDomid(self): return self.domid + def getStubdomDomid(self): + dom_list = xstransact.List('/local/domain') + for d in dom_list: + target = xstransact.Read('/local/domain/' + d + '/target') + if target is not None and int(target) is self.domid : + return int(d) + return None + def setName(self, name, to_store = True): self._checkName(name) self.info['name_label'] = name diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index 2bbe9b484a..faf12eabce 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -591,7 +591,11 @@ class ImageHandler: return self.sentinel_lock.acquire() try: - if self.pid: + stubdomid = self.vm.getStubdomDomid() + if stubdomid is not None : + from xen.xend import XendDomain + XendDomain.instance().domain_destroy(stubdomid) + elif self.pid: try: os.kill(self.pid, signal.SIGHUP) except OSError, exn: |