debuggers.hg
changeset 21270:a7947fd90328
xend: earlier remove the backend of tapdisk device in
xenstore to release the resource allocated in backend driver
lies in dom0'kernel
Blktapctl thread will use qemu-dm connection instead of tapdisk-ioemu
in the case of FV VM. We found the resource like memory allocated for
this Guest can't be free for backend driver couldn't be closed in qemu-dm.
This patch would remove the backend of tapdisk device earlier in
xenstore to triger qemu-dm to notify the backend driver to release the
resource allocated.
I have tested this patch at the case of
1, save && restore
2, destory && shutdown
3, snapshot
Signed-off-by: James ( Song Wei ) <jsong@novell.com>
xenstore to release the resource allocated in backend driver
lies in dom0'kernel
Blktapctl thread will use qemu-dm connection instead of tapdisk-ioemu
in the case of FV VM. We found the resource like memory allocated for
this Guest can't be free for backend driver couldn't be closed in qemu-dm.
This patch would remove the backend of tapdisk device earlier in
xenstore to triger qemu-dm to notify the backend driver to release the
resource allocated.
I have tested this patch at the case of
1, save && restore
2, destory && shutdown
3, snapshot
Signed-off-by: James ( Song Wei ) <jsong@novell.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Thu Apr 22 09:44:29 2010 +0100 (2010-04-22) |
parents | 5b72f9832cc2 |
children | 2b97855a629f |
files | tools/python/xen/xend/XendDomainInfo.py |
line diff
1.1 --- a/tools/python/xen/xend/XendDomainInfo.py Thu Apr 22 09:42:37 2010 +0100 1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py Thu Apr 22 09:44:29 2010 +0100 1.3 @@ -2408,8 +2408,13 @@ class XendDomainInfo: 1.4 1.5 def _releaseDevices(self, suspend = False): 1.6 """Release all domain's devices. Nothrow guarantee.""" 1.7 + t = xstransact("%s/device" % self.vmpath) 1.8 if self.image: 1.9 try: 1.10 + for dev in t.list('tap'): 1.11 + log.debug("Early removing %s", dev); 1.12 + self.getDeviceController('tap').destroyDevice(dev, True) 1.13 + time.sleep(0.1) 1.14 log.debug("Destroying device model") 1.15 self.image.destroyDeviceModel() 1.16 except Exception, e: 1.17 @@ -2418,9 +2423,10 @@ class XendDomainInfo: 1.18 log.debug("No device model") 1.19 1.20 log.debug("Releasing devices") 1.21 - t = xstransact("%s/device" % self.vmpath) 1.22 try: 1.23 for devclass in XendDevices.valid_devices(): 1.24 + if devclass is 'tap': 1.25 + continue 1.26 for dev in t.list(devclass): 1.27 try: 1.28 log.debug("Removing %s", dev);