All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Test tap devices in testDeviceComplete()
@ 2009-03-10  9:19 Jiri Denemark
  2009-03-10  9:31 ` Christoph Egger
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Denemark @ 2009-03-10  9:19 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

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.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>

[-- Attachment #2: xend-check-released-tap-devices.patch --]
[-- Type: text/plain, Size: 673 bytes --]

diff -r b249f3e979a5 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Mon Mar 09 10:32:24 2009 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Mar 10 09:59:16 2009 +0100
@@ -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)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Test tap devices in testDeviceComplete()
  2009-03-10  9:19 [PATCH] Test tap devices in testDeviceComplete() Jiri Denemark
@ 2009-03-10  9:31 ` Christoph Egger
  2009-03-10  9:57   ` Jiri Denemark
  2009-03-10 10:01   ` Keir Fraser
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Egger @ 2009-03-10  9:31 UTC (permalink / raw)
  To: xen-devel; +Cc: Jiri Denemark

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

-- 
---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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Test tap devices in testDeviceComplete()
  2009-03-10  9:31 ` Christoph Egger
@ 2009-03-10  9:57   ` Jiri Denemark
  2009-03-10 10:01   ` Keir Fraser
  1 sibling, 0 replies; 4+ messages in thread
From: Jiri Denemark @ 2009-03-10  9:57 UTC (permalink / raw)
  To: Christoph Egger; +Cc: xen-devel

> > 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

-- 
Immorality: the morality of those who are having a better time.
                -- H. L. Mencken

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Test tap devices in testDeviceComplete()
  2009-03-10  9:31 ` Christoph Egger
  2009-03-10  9:57   ` Jiri Denemark
@ 2009-03-10 10:01   ` Keir Fraser
  1 sibling, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2009-03-10 10:01 UTC (permalink / raw)
  To: Christoph Egger, xen-devel@lists.xensource.com; +Cc: Jiri Denemark

On 10/03/2009 09:31, "Christoph Egger" <Christoph.Egger@amd.com> wrote:

>> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-10 10:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-10  9:19 [PATCH] Test tap devices in testDeviceComplete() Jiri Denemark
2009-03-10  9:31 ` Christoph Egger
2009-03-10  9:57   ` Jiri Denemark
2009-03-10 10:01   ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.