Skip to contentSkip to conversation

Relax the sanity check on guest configuration with XSM-ACM addlabel

PATCH New INAKOSHI Hiroya 1 participant 1 message Nov 28, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Relax the sanity check on guest configuration with XSM-ACM addlabel

The attached patch relaxes the sanity check on guest configuration when you assign a acm label to the guest. This patch makes a guest configuration accept a bootloader parameter. This is common for paravirtualized guests to boot them by using pygrub.

The relaxed way of sanity cheking is not exact in terms of ignoring the case where kernel and bootloader parameter coincide. That is apparantly incorrect, but an exact way requires double loops and it was a bit boring to me.

tools/python/xen/xm/addlabel.py +3 -2
diff -r 5fd51e1e9c79 tools/python/xen/xm/addlabel.py
@@ -64,12 +64,13 @@ def validate_config_file(configfile):
         return 0
 
     # sanity check on the data from the file
+    # requiring 'memory,' 'name,' and ether 'kernel' or 'bootloader'
     count = 0
-    required = ['kernel', 'memory', 'name']
+    required = ['kernel', 'bootloader', 'memory', 'name']
     for (k, v) in locs.items():
         if k in required:
             count += 1
-    if count != 3:
+    if count < len(required) - 1:
         print "Invalid configuration file."
         return 0
     else:

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