debuggers.hg

changeset 21009:70d974c2401d

Fix blktap2 test in xen-hotplug-cleanup

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 =3D ""
51952 =3D ""
frontend =3D "/local/domain/0/device/vbd/51952"
frontend-id =3D "0"
backend-id =3D "0"
backend =3D "/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]

From: Jim Fehlig <jfehlig@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Feb 22 10:07:27 2010 +0000 (2010-02-22)
parents 243614f8360c
children 94e009ef5a58
files tools/hotplug/Linux/xen-hotplug-cleanup
line diff
     1.1 --- a/tools/hotplug/Linux/xen-hotplug-cleanup	Mon Feb 22 10:06:21 2010 +0000
     1.2 +++ b/tools/hotplug/Linux/xen-hotplug-cleanup	Mon Feb 22 10:07:27 2010 +0000
     1.3 @@ -21,7 +21,7 @@ if [ "$vm" != "" ]; then
     1.4  
     1.5    # if the vm path does not exist and the device class is 'vbd' then we may have
     1.6    # a tap2 device
     1.7 -  if [ ! $(xenstore-read "vm_dev" 2>/dev/null) ] \
     1.8 +  if [ $(xenstore-read "$vm_dev" 2>/dev/null) != "" ] \
     1.9         && [ "${path_array[1]}" = "vbd" ]; then
    1.10      vm_dev="$vm/device/tap2/${path_array[3]}"
    1.11    fi