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

[Xen-changelog] [xen-unstable] [XEND] Fix bootable flag bypass in XendConfig



# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Date 1170158187 0
# Node ID 5165b7ecbff53eede602ba2c247ffe857f2c5bb9
# Parent  bca858b72bf8038b14dbbd7bb1431897c95b2fc2
[XEND] Fix bootable flag bypass in XendConfig

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendConfig.py          |    8 ++++----
 tools/python/xen/xend/server/XMLRPCServer.py |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff -r bca858b72bf8 -r 5165b7ecbff5 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Tue Jan 30 11:37:18 2007 +0000
+++ b/tools/python/xen/xend/XendConfig.py       Tue Jan 30 11:56:27 2007 +0000
@@ -881,10 +881,10 @@ class XendConfig(dict):
                             if sxp.name(config) in ('vbd', 'tap'):
                                 # The bootable flag is never written to the
                                 # store as part of the device config.
-                                uuid = sxp.child_value(sxpr, 'uuid')
-                                sxpr.append(
-                                    'bootable', 
-                                    self['devices'][dev_uuid]['bootable'])
+                                dev_uuid = sxp.child_value(config, 'uuid')
+                                dev_type, dev_cfg = self['devices'][dev_uuid]
+                                config.append(['bootable',
+                                               int(dev_cfg['bootable'])])
                             sxpr.append(['device', config])
 
                         found = True
diff -r bca858b72bf8 -r 5165b7ecbff5 
tools/python/xen/xend/server/XMLRPCServer.py
--- a/tools/python/xen/xend/server/XMLRPCServer.py      Tue Jan 30 11:37:18 
2007 +0000
+++ b/tools/python/xen/xend/server/XMLRPCServer.py      Tue Jan 30 11:56:27 
2007 +0000
@@ -34,7 +34,7 @@ def fixup_sxpr(sexpr):
 def fixup_sxpr(sexpr):
     ret = []
     for k in sexpr:
-        if type(k) in (types.ListType, types.TupleType):
+        if type(k) in (list, tuple):
             if len(k) != 2 or k[0] != 'vcpu_avail':
                 ret.append(fixup_sxpr(k))
         else:

_______________________________________________
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®.