mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
xend: destroy stubdoms synchronously
This patch makes the destruction of stubdoms a synchronous event, therefore it is no longer possible to run out of memory when rebooting a guest because the stubdom of the old guest is always destroyed before the creation of the new guest. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
1 parent
b1fd365cec
commit
51f36202c4
3 files changed
+19
-13
No files matched your search
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||