direct-io.hg

changeset 11470:2b8dc69744e3

This patch adds syntax checking for "xm block-attach" command.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Ewan Mellor <ewan@xensource.com>
date Thu Sep 14 07:55:28 2006 +0100 (2006-09-14)
parents 25ece14b6234
children 4bac02935c87 0bdd578c417f
files tools/python/xen/xend/server/blkif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/blkif.py	Thu Sep 14 07:55:27 2006 +0100
     1.2 +++ b/tools/python/xen/xend/server/blkif.py	Thu Sep 14 07:55:28 2006 +0100
     1.3 @@ -64,10 +64,14 @@ class BlkifController(DevController):
     1.4              except ValueError:
     1.5                  (typ, params) = ("", "")
     1.6  
     1.7 +        mode = sxp.child_value(config, 'mode', 'r')
     1.8 +        if mode not in ('r', 'w', 'w!'):
     1.9 +            raise VmError('Invalid mode')
    1.10 +
    1.11          back = { 'dev'    : dev,
    1.12                   'type'   : typ,
    1.13                   'params' : params,
    1.14 -                 'mode'   : sxp.child_value(config, 'mode', 'r')
    1.15 +                 'mode'   : mode
    1.16                 }
    1.17  
    1.18          if security.on():