Skip to contentSkip to conversation

Add syntax check for block devices

PATCH In review Masaki Kanno 2 participants 3 messages May 12, 2008 – May 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add syntax check for block devices

Hi,

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']

This patch adds syntax checks of disk types.

Best regards,
Kan

tools/python/xen/xend/server/blkif.py +5 -1
diff -r 810d8c3ac992 tools/python/xen/xend/server/blkif.py
@@ -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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Hi,

I cannnot boot a guest with disks of 'tap' type specified in the config file since cs 17617, unfortunately :-( Attached patch would fix the issue.

Thanks,
-- Yosuke

Quoted 22 lines · Masaki Kanno

Hi,

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']

This patch adds syntax checks of disk types.

Best regards,
Kan

Quoted 6 lines

------------------------------------------------------------------------

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Xend: Fix blkif type check for tap devices.

tools/python/xen/xend/server/blkif.py +3 -2
diff -r 0a8fc1a62796 tools/python/xen/xend/server/blkif.py
@@ -56,9 +56,10 @@ class BlkifController(DevController):
         else:
             try:
                 (typ, params) = string.split(uname, ':', 1)
-                if typ not in ('phy', 'file'):
+                if typ not in ('phy', 'file', 'tap'):
                     raise VmError(
-                        'Block device must have "phy" or "file" specified to type')
+                        'Block device must have "phy", "file" or "tap" '
+                        'specified to type')
             except ValueError:
                 raise VmError(
                     'Block device must have physical details specified')

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 8 lines · Yosuke Iwamatsu

Hi,

I cannnot boot a guest with disks of 'tap' type specified in the config file since cs 17617, unfortunately :-( Attached patch would fix the issue.

Thanks,
-- Yosuke

Oops! Thank you, Yosuke.

Best regards,
Kan

Quoted 37 lines
Quoted 22 lines · Masaki Kanno

Hi,

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']

This patch adds syntax checks of disk types.

Best regards,
Kan

Quoted 6 lines

------------------------------------------------------------------------

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

-------------------------------text/plain-------------------------------
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel