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

[Xen-changelog] [xen-unstable] This patch adds syntax checking for "xm block-attach" command.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID 2b8dc69744e3ae99d6c59eab7b229ae4259170e3
# Parent  25ece14b6234eda0e32ef0105654ed82380cbafa
This patch adds syntax checking for "xm block-attach" command.

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 25ece14b6234 -r 2b8dc69744e3 tools/python/xen/xend/server/blkif.py
--- a/tools/python/xen/xend/server/blkif.py     Thu Sep 14 07:55:27 2006 +0100
+++ b/tools/python/xen/xend/server/blkif.py     Thu Sep 14 07:55:28 2006 +0100
@@ -64,10 +64,14 @@ class BlkifController(DevController):
             except ValueError:
                 (typ, params) = ("", "")
 
+        mode = sxp.child_value(config, 'mode', 'r')
+        if mode not in ('r', 'w', 'w!'):
+            raise VmError('Invalid mode')
+
         back = { 'dev'    : dev,
                  'type'   : typ,
                  'params' : params,
-                 'mode'   : sxp.child_value(config, 'mode', 'r')
+                 'mode'   : mode
                }
 
         if security.on():

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.