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

[Xen-devel] Fwd: Avoid said the /dev/xvd* is already defined after open a vhd file failed




Hi Guys,

can you do me a favor to check it. Thanks.

From 9f45c734af00a1af71f7cd69f0473474bcd739da Mon Sep 17 00:00:00 2001
From: Yi Li <peteryili@xxxxxxxxxxx>
Date: Wed, 19 Mar 2014 22:54:16 +0800
Subject: [PATCH] Avoid said the /dev/xvd* is already defined after
open a vhd file failed

For example:
[root@dom0_134_103 ~]# xm block-attach 0 tap2:tapdisk:vhd:/root/liyi***.vhd /dev/xvdz Âw
Error: ('create', '-avhd:/root/liyi***.vhd') failed (512 Â)
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]
Create a new virtual block device.

[root@dom0_134_103 ~]# xm block-attach 0 tap2:tapdisk:vhd:/root/liyi.vhd /dev/xvdz Âw
Error: The device "/dev/xvdz" is already defined
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]

Create a new virtual block device.

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

Attachment: 0001-Avoid-said-the-dev-xvd-is-already-defined-after-open.patch
Description: Binary data

_______________________________________________
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®.