From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: [PATCH] Fix blktap2 test in xen-hotplug-cleanup Date: Sun, 21 Feb 2010 21:29:47 -0700 Message-ID: <4B82083B.6010506@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000504060600080208090606" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000504060600080208090606 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The blktap2 test in xen-hotplug-cleanup was not quite right, causing orphaned /vm//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 [BackDomain] Attached patch fixes the test. Regards, Jim --------------000504060600080208090606 Content-Type: text/x-patch; name="hotplug-cleanup-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hotplug-cleanup-fix.patch" 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 --------------000504060600080208090606 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000504060600080208090606--