WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] earlier remove the backend of tapdisk device in xenstore to

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] earlier remove the backend of tapdisk device in xenstore to release the resource allocated in backend driver lies in dom0'kernel
From: "James (song wei)" <jsong@xxxxxxxxxx>
Date: Thu, 22 Apr 2010 01:08:41 -0700 (PDT)
Delivery-date: Thu, 22 Apr 2010 01:09:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

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

regards,

-James (Song Wei)



Signed-off-by: James ( Song Wei ) <jsong@xxxxxxxxxx> 
diff -r fadf63ab49e7 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Apr 19 17:57:28 2010
+0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Apr 22 15:54:01 2010
+0800
@@ -2406,8 +2406,13 @@

     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:
@@ -2416,9 +2421,10 @@
             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);
                                                                  
http://old.nabble.com/file/p28325456/tapdisk-close.patch tapdisk-close.patch 
-- 
View this message in context: 
http://old.nabble.com/earlier-remove-the-backend-of-tapdisk-device-in-xenstore-to-release-the-resource-allocated-in-backend-driver-lies-in-dom0%27kernel-tp28325456p28325456.html
Sent from the Xen - Dev mailing list archive at Nabble.com.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel