WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [Patch] Relax the sanity check on guest configuration with X

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [Patch] Relax the sanity check on guest configuration with XSM-ACM addlabel
From: INAKOSHI Hiroya <inakoshi.hiroya@xxxxxxxxxxxxxx>
Date: Fri, 28 Nov 2008 09:58:53 +0900
Delivery-date: Thu, 27 Nov 2008 16:59:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.18 (Windows/20081105)
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.

Signed-off-by: INAKOSHI Hiroya <inakoshi.hiroya@xxxxxxxxxxxxxx>
diff -r 5fd51e1e9c79 tools/python/xen/xm/addlabel.py
--- a/tools/python/xen/xm/addlabel.py   Wed Nov 05 10:57:21 2008 +0000
+++ b/tools/python/xen/xm/addlabel.py   Tue Nov 11 16:24:34 2008 +0900
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [Patch] Relax the sanity check on guest configuration with XSM-ACM addlabel, INAKOSHI Hiroya <=