[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xend: Add syntax check for block devices
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1210587549 -3600 # Node ID 0a8fc1a6279647ab625377a35413429d52b5d454 # Parent 0f18d5454c7b6f6a338d16571a064ef5c219c06c xend: Add syntax check for block devices If we define wrong values to a disk parameter in domain configuration files, we get an error message or a guest OS panic. 1. If we define a wrong disk type, xm create command error occurs about 100 seconds later. e.g. disk=['xyz:/xen/root-vm1.img,hda1,w'] 2. If we forget a disk type, a guest OS panic occurs. e.g. disk=['/xen/root-vm1.img,hda1,w'] Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx> --- tools/python/xen/xend/server/blkif.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) diff -r 0f18d5454c7b -r 0a8fc1a62796 tools/python/xen/xend/server/blkif.py --- a/tools/python/xen/xend/server/blkif.py Mon May 12 11:16:43 2008 +0100 +++ b/tools/python/xen/xend/server/blkif.py Mon May 12 11:19:09 2008 +0100 @@ -56,8 +56,12 @@ class BlkifController(DevController): else: try: (typ, params) = string.split(uname, ':', 1) + if typ not in ('phy', 'file'): + raise VmError( + 'Block device must have "phy" or "file" specified to type') except ValueError: - (typ, params) = ("", "") + raise VmError( + 'Block device must have physical details specified') mode = config.get('mode', 'r') if mode not in ('r', 'w', 'w!'): _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |