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/
Home Products Support Community News


[Xen-changelog] Wait for the device to be connected on the guest (with a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Wait for the device to be connected on the guest (with a 10s timeout)
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 Apr 2006 18:06:09 +0000
Delivery-date: Fri, 28 Apr 2006 11:07:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID e0e68942b205b395fe99f7a338a448ddadd9c9fd
# Parent  5931e98cd744e4cc49640a72967112669197b495
Wait for the device to be connected on the guest (with a 10s timeout)
before detaching it. Fix a race condition that dom0 was tearing down the
block device while the guest was putting it in a Connected state.

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxx>

diff -r 5931e98cd744 -r e0e68942b205 
--- a/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py      
Fri Apr 28 14:48:50 2006 +0100
+++ b/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py      
Fri Apr 28 16:44:00 2006 +0100
@@ -26,6 +26,12 @@ def checkXmLongList(domain):
         return False
+def checkBlockState(domain):
+    s, o = traceCommand("xm block-list %s | awk '{print $4}' |tail -n 1" % 
+    if s != 0:
+        FAIL("block-list failed")
+    return int(o)
     SKIP("Block-detach not supported for HVM domains")
@@ -46,7 +52,11 @@ if not checkXmLongList(domain):
 if not checkXmLongList(domain):
     FAIL("xm long list does not show that hda1 was attached")
+for i in range(1, 10):
+    time.sleep(1)
+    state = checkBlockState(domain)
+    if state == 4:
+        break
 s, o = traceCommand("xm block-detach %s hda1" % domain.getName())
 if s != 0:

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Wait for the device to be connected on the guest (with a 10s timeout), Xen patchbot -unstable <=