[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen: handle TapdiskException when xm block-attach failed
Maybe we should check the vhd file is exist or not: From: Yi Li <peteryili@xxxxxxxxxxx> Date: Thu, 20 Mar 2014 17:15:00 +0800 Subject: [PATCH] xen: check the vhd file exist using block-attach Signed-off-by: Yi Li <peteryili@xxxxxxxxxxx> diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index 5ed781c..1416db9 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -2650,6 +2650,19 @@ def parse_block_configuration(args): Âdef xm_block_attach(args): ÂÂÂÂ arg_check(args, 'block-attach', 4, 5) Â +ÂÂÂ #check back_dev and front_dev, by tlinux_xen team +ÂÂÂ uname=args[1] +ÂÂÂ uname_list=uname.split(":") +ÂÂÂ back_dev=uname_list[len(uname_list)-1] +ÂÂÂ front_dev=args[2] if ("/dev" in args[2]) else ("/dev/" + args[2]) +ÂÂÂ if not os.path.exists(back_dev): +ÂÂÂÂÂÂÂ print "Error: %s not exist " % back_dev +ÂÂÂÂÂÂÂ sys.exit(1) + +ÂÂÂ if os.path.exists(front_dev): +ÂÂÂÂÂÂÂ print "Error: %s already exists " % front_dev +ÂÂÂÂÂÂÂ sys.exit(1) + ÂÂÂÂ if serverType == SERVER_XEN_API: ÂÂÂÂÂÂÂÂ domÂÂ = args[0] ÂÂÂÂÂÂÂÂ uname = args[1] -- 1.7.1 2014-03-20 9:47 GMT+08:00 æä <yilikernel@xxxxxxxxx>:
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |