diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-04-22 09:44:29 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-04-22 09:44:29 +0100 |
commit | 3dc27ee3852c9803ee87ff93224f0f33a49096ab (patch) | |
tree | 59bb9b95125c297be119e9b8518b4e86cbcedc9d | |
parent | 77af399e7ff34b3978f5271843e38bce1d66077d (diff) | |
download | xen-3dc27ee3852c9803ee87ff93224f0f33a49096ab.tar.gz xen-3dc27ee3852c9803ee87ff93224f0f33a49096ab.tar.bz2 xen-3dc27ee3852c9803ee87ff93224f0f33a49096ab.zip |
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>
-rw-r--r-- | tools/python/xen/xend/XendDomainInfo.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index dcf26a9886..b8f7296a30 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -2408,8 +2408,13 @@ class XendDomainInfo: def _releaseDevices(self, suspend = False): """Release all domain's devices. Nothrow guarantee.""" + t = xstransact("%s/device" % self.vmpath) if self.image: try: + for dev in t.list('tap'): + log.debug("Early removing %s", dev); + self.getDeviceController('tap').destroyDevice(dev, True) + time.sleep(0.1) log.debug("Destroying device model") self.image.destroyDeviceModel() except Exception, e: @@ -2418,9 +2423,10 @@ class XendDomainInfo: log.debug("No device model") log.debug("Releasing devices") - t = xstransact("%s/device" % self.vmpath) try: for devclass in XendDevices.valid_devices(): + if devclass is 'tap': + continue for dev in t.list(devclass): try: log.debug("Removing %s", dev); |