All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix blktap2 test in xen-hotplug-cleanup
@ 2010-02-22  4:29 Jim Fehlig
  0 siblings, 0 replies; only message in thread
From: Jim Fehlig @ 2010-02-22  4:29 UTC (permalink / raw)
  To: xen-devel

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

The blktap2 test in xen-hotplug-cleanup was not quite right, causing
orphaned /vm/<uuid>/device node in xenstore.  Attempt to reattach the
device failed:

xen53: # xm block-attach 0 file:/tmp/d0 /dev/xvdp r
xen53: # xm block-detach 0 /dev/xvdp
xen53: # xenstore-ls /vm/00000000-0000-0000-0000-000000000000/device
vbd = ""
 51952 = ""
  frontend = "/local/domain/0/device/vbd/51952"
  frontend-id = "0"
  backend-id = "0"
  backend = "/local/domain/0/backend/vbd/0/51952"
xen53: # xm block-attach 0 file:/tmp/d0 /dev/xvdp r
Error: Device /dev/xvdp (51952, vbd) is already connected.
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]

Attached patch fixes the test.

Regards,
Jim

[-- Attachment #2: hotplug-cleanup-fix.patch --]
[-- Type: text/x-patch, Size: 618 bytes --]

Index: xen-4.0.0-testing/tools/hotplug/Linux/xen-hotplug-cleanup
===================================================================
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/xen-hotplug-cleanup
+++ xen-4.0.0-testing/tools/hotplug/Linux/xen-hotplug-cleanup
@@ -21,7 +21,7 @@ if [ "$vm" != "" ]; then
 
   # if the vm path does not exist and the device class is 'vbd' then we may have
   # a tap2 device
-  if [ ! $(xenstore-read "vm_dev" 2>/dev/null) ] \
+  if [ $(xenstore-read "$vm_dev" 2>/dev/null) != "" ] \
        && [ "${path_array[1]}" = "vbd" ]; then
     vm_dev="$vm/device/tap2/${path_array[3]}"
   fi

[-- 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] only message in thread

only message in thread, other threads:[~2010-02-22  4:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22  4:29 [PATCH] Fix blktap2 test in xen-hotplug-cleanup Jim Fehlig

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.