Skip to contentSkip to conversation

Test tap devices in testDeviceComplete()

PATCH In review Jiri Denemark 3 participants 4 messages Mar 10, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Test tap devices in testDeviceComplete()

Hi,

XendDomainInfo.testDeviceComplete() should check block devices have shutdown correctly but it only considers vbd class devices and ignores tap devices. The attached patch changes testDeviceComplete() to wait for both vbd and tap devices to be shutdown correctly.

tools/python/xen/xend/XendDomainInfo.py +3 -1
diff -r b249f3e979a5 tools/python/xen/xend/XendDomainInfo.py
@@ -2888,7 +2888,9 @@
         while True:
             test = 0
             diff = time.time() - start
-            for i in self.getDeviceController('vbd').deviceIDs():
+            vbds = self.getDeviceController('vbd').deviceIDs()
+            taps = self.getDeviceController('tap').deviceIDs()
+            for i in vbds + taps:
                 test = 1
                 log.info("Dev %s still active, looping...", i)
                 time.sleep(0.1)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 6 lines · On Tuesday 10 March 2009 10:19:23 Jiri Denemark wrote:

Hi,

XendDomainInfo.testDeviceComplete() should check block devices have shutdown correctly but it only considers vbd class devices and ignores tap devices. The attached patch changes testDeviceComplete() to wait for both vbd and tap devices to be shutdown correctly.

Has this also been tested with PV guests ? In that case, there are no tap devices to shutdown.

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#2 lore raw
Quoted 7 lines
Quoted 4 lines

XendDomainInfo.testDeviceComplete() should check block devices have shutdown correctly but it only considers vbd class devices and ignores tap devices. The attached patch changes testDeviceComplete() to wait for both vbd and tap devices to be shutdown correctly.

Has this also been tested with PV guests ? In that case, there are no tap devices to shutdown.

Hmm, testDeviceComplete() is called after _releaseDevices(), which destroys all devices. And even for a PV guest, I can see tap devices in /vm/UUID/device/tap tree in xenstore.

vm = ""
0829a755-d2ed-607e-5847-ce9ec19e7422 = ""
image = "(linux (kernel ) (videoram 4) (notes..."
ostype = "linux"
kernel = "/var/run/xend/boot/boot_kernel.QsXCO7" cmdline = "ro root=LABEL=/ selinux=0" ramdisk = "/var/run/xend/boot/boot_ramdisk.UzyMl2"
device = ""
tap = ""

    51712 = ""
     frontend = "/local/domain/2/device/vbd/51712"
     frontend-id = "2"
     backend-id = "0"
     backend = "/local/domain/0/backend/tap/2/51712"

That is, that device will be destroyed by _releaseDevices although not tested by testDeviceComplete to be completed.

Anyway, this is a bit hard to test, as this code patch is only used when guest's kernel lacks SUSPEND_CANCEL feature, which is present in current Xen kernels. While, I have a kernel without this feature, it also lacks some other parts and the guest crashes...

On the other hand, I tested this on older Xen tools which match the kernel. This code path hasn't really changed since than.

Jirka

Signature · 2 lines
Immorality: the morality of those who are having a better time.
                -- H. L. Mencken
#3 lore raw
In reply to Christoph Egger
Quoted 7 lines · Christoph Egger
Quoted 4 lines

XendDomainInfo.testDeviceComplete() should check block devices have shutdown correctly but it only considers vbd class devices and ignores tap devices. The attached patch changes testDeviceComplete() to wait for both vbd and tap devices to be shutdown correctly.

Has this also been tested with PV guests ? In that case, there are no tap devices to shutdown.

Tap vs vbd is orthogional to PV vs HVM. Either type of guest can use either type of storage backend. This detail is hidden from blkfront.

-- Keir