This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-unstable] xend: earlier remove the backend of tapdi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: earlier remove the backend of tapdisk device in
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Apr 2010 17:30:22 -0700
Delivery-date: Thu, 22 Apr 2010 17:31:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271925869 -3600
# Node ID a7947fd90328287dd097294b241753063c858597
# Parent  5b72f9832cc21ebdbbd8569836578817353314d8
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@xxxxxxxxxx>
 tools/python/xen/xend/XendDomainInfo.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -r 5b72f9832cc2 -r a7947fd90328 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Apr 22 09:42:37 2010 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Apr 22 09:44:29 2010 +0100
@@ -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:
+                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")
             except Exception, e:
@@ -2418,9 +2423,10 @@ class XendDomainInfo:
             log.debug("No device model")
         log.debug("Releasing devices")
-        t = xstransact("%s/device" % self.vmpath)
             for devclass in XendDevices.valid_devices():
+                if devclass is 'tap':
+                    continue
                 for dev in t.list(devclass):
                         log.debug("Removing %s", dev);

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: earlier remove the backend of tapdisk device in, Xen patchbot-unstable <=