[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen: handle TapdiskException when xm block-attach failed



Hi ALL,

Maybe we can check the file whether it is exist at the function xm_block_attach

But i perfer that we should handle the TapdiskException.

YiLi

2014-03-20 9:25 GMT+08:00 æä <yilikernel@xxxxxxxxx>:
From 7a4b67d235569d81307095ad1366bc03bae5b812 Mon Sep 17 00:00:00 2001
From: Yi Li <peteryili@xxxxxxxxxxx>
Date: Thu, 20 Mar 2014 09:15:45 +0800
Subject: [PATCH] xen: handle TapdiskException when xm block-attach failed

Maybe we should handle the TapdiskException for the command below
'xm block-attach 0 tap2:tapdisk:vhd:/root/a.vhd /dev/xvdz w'
or /dev/xvdz said it is already defined.

Signed-off-by: Yi Li <peteryili@xxxxxxxxxxx>
---
Âtools/python/xen/xend/XendDomainInfo.py |ÂÂÂ 4 ++--
Â1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 8d4ff5c..2270ab1 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -65,7 +65,7 @@ from xen.xend.XendConstants import *
Âfrom xen.xend.XendAPIConstants import *
Âfrom xen.xend.XendCPUPool import XendCPUPool
Âfrom xen.xend.server.DevConstants import xenbusState
-from xen.xend.server.BlktapController import TapdiskController
+from xen.xend.server.BlktapController import TapdiskController, TapdiskException

Âfrom xen.xend.XendVMMetrics import XendVMMetrics

@@ -861,7 +861,7 @@ class XendDomainInfo:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ # blktap1
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ dev_type = self.getBlockDeviceClass(devid)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ self._waitForDevice(dev_type, devid)
-ÂÂÂÂÂÂÂÂÂÂÂ except VmError, ex:
Â
+ÂÂÂÂÂÂÂÂÂÂÂ except (VmError, TapdiskException), ex:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ del self.info['devices'][dev_uuid]
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if dev_type == 'pci':
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ for dev in dev_config_dict['devs']:
--
1.7.1

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.