WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel][PATCH]fix bug that detach tap2 disk device info not cleared

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel][PATCH]fix bug that detach tap2 disk device info not cleared from xenstore /vm/uuid
From: "Chun Yan Liu" <cyliu@xxxxxxxxxx>
Date: Thu, 02 Dec 2010 23:47:06 -0700
Delivery-date: Thu, 02 Dec 2010 22:48:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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>

diff -r 3c4c3d48a835 tools/hotplug/Linux/xen-hotplug-cleanup
--- a/tools/hotplug/Linux/xen-hotplug-cleanup    Thu Aug 26 11:16:56 2010 +0100
+++ b/tools/hotplug/Linux/xen-hotplug-cleanup    Fri Dec 03 22:47:04 2010 +0800
@@ -21,10 +21,12 @@
 
   # 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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>