Skip to contentSkip to conversation

Fix error message when detaching block devices

PATCH In review Stefan Berger 2 participants 3 messages Dec 16, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix error message when detaching block devices

An error occurs if the first detach was successful and the 2nd one is not (of course). Return if the 1st detach is successful, try the 2nd one if it was not successful. Throw an error if the 2nd one fails. This should also fix problems I am currently seeing in the xm-test suite.

tools/python/xen/xm/main.py +5 -1
diff -r c6f637694b85 tools/python/xen/xm/main.py
@@ -1556,7 +1556,11 @@ def detach(args, command, deviceClass):
 
 
 def xm_block_detach(args):
-    detach(args, 'block-detach', 'vbd')
+    try:
+        detach(args, 'block-detach', 'vbd')
+        return
+    except:
+        pass
     detach(args, 'block-detach', 'tap')
 
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 7 lines · Stefan Berger

An error occurs if the first detach was successful and the 2nd one is not (of course). Return if the 1st detach is successful, try the 2nd one if it was not successful. Throw an error if the 2nd one fails. This should also fix problems I am currently seeing in the xm-test suite.

I've applied this, because it looks perfectly sensible, but I'm concerned that this failure isn't showing up in our xm-test runs. What failure are you seeing?

Ewan.

#2 lore raw

Ewan Mellor <[email protected]> wrote on 12/16/2006 07:54:01 AM:

Quoted 4 lines · Stefan Berger
Quoted 3 lines

An error occurs if the first detach was successful and the 2nd one is not (of course). Return if the 1st detach is successful, try the 2nd

one

Quoted 9 lines
Quoted 5 lines

if it was not successful. Throw an error if the 2nd one fails. This should also fix problems I am currently seeing in the xm-test suite.

I've applied this, because it looks perfectly sensible, but I'm concerned that this failure isn't showing up in our xm-test runs. What failure are you seeing?

I got the message
REASON: xm block-detach returned invalid 256 != 0

After this fix this message was gone.

Stefan

Quoted 2 lines

Ewan.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel