[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix /vm/uuid xenstore leak on tapdisk2 device cleanup



# HG changeset patch
# User Chunyan Liu <cyliu@xxxxxxxxxx>
# Date 1292261967 0
# Node ID a5a0817d92104b61a5db5989c2a57aff430023bc
# Parent  a40455ae9ad3f1d0ff057fb61b833223c95fc762
Fix /vm/uuid xenstore leak on tapdisk2 device cleanup

While doing block-detach blktap2 disk, tap2 device info is not cleared from
xenstore /vm/uuid/xxx. The reason is in xen-hotplug-cleanup script: when $vm_dev
does not exist, $(xenstore-read "$vm_dev" 2>/dev/null) is also "", won't enter
the block. So, change to use cmd return value to check existence.

Signed-off-by Chunyan Liu <cyliu@xxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
committer: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/hotplug/Linux/xen-hotplug-cleanup |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -r a40455ae9ad3 -r a5a0817d9210 tools/hotplug/Linux/xen-hotplug-cleanup
--- a/tools/hotplug/Linux/xen-hotplug-cleanup   Mon Dec 13 17:15:31 2010 +0000
+++ b/tools/hotplug/Linux/xen-hotplug-cleanup   Mon Dec 13 17:39:27 2010 +0000
@@ -21,10 +21,12 @@ 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)" != "" ] \
-       && [ "${path_array[1]}" = "vbd" ]; then
-    vm_dev="$vm/device/tap2/${path_array[3]}"
-  fi
+  $(xenstore-read "$vm_dev" 2>/dev/null) || \
+  {
+     if [ "${path_array[1]}" = "vbd" ]; then
+        vm_dev="$vm/device/tap2/${path_array[3]}"
+     fi
+  }
 else
   vm_dev=
 fi

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.