From: Stefan Berger Subject: [PATCH] Fix error message when detaching block devices Date: Fri, 15 Dec 2006 23:46:06 -0500 Message-ID: <1166244366.7975.7.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-IB1G1BfBvCgPWPPBZy0N" 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 --=-IB1G1BfBvCgPWPPBZy0N Content-Type: text/plain Content-Transfer-Encoding: 7bit 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. Signed-off-by: Stefan Berger --=-IB1G1BfBvCgPWPPBZy0N Content-Disposition: attachment; filename=xm-main-fix-block-detach.diff Content-Type: text/x-patch; name=xm-main-fix-block-detach.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -r c6f637694b85 tools/python/xen/xm/main.py --- a/tools/python/xen/xm/main.py Fri Dec 15 11:53:45 2006 +0000 +++ b/tools/python/xen/xm/main.py Sat Dec 16 00:16:07 2006 -0500 @@ -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') --=-IB1G1BfBvCgPWPPBZy0N 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 --=-IB1G1BfBvCgPWPPBZy0N--