Skip to contentSkip to conversation

Fix domain creation with bootloaders

PATCH Applied Daniel P. Berrange 2 participants 2 messages Dec 7, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix domain creation with bootloaders

Some of the re-factoring work for XenAPI support in current xen-devel has broken the creation of guests using a bootloader if done via the SEXPR API. The first issue is that 'bootloader' is classed as legacy unsupported in the XenConfig.py class, and the special fallback processing for it is missing. The second issue apears to be that one of the methods called from _configureBootloader() has changed the format of the data it returns. The reason this was not caught earlier is that 'xm' typically runs the bootloader client side, but libvirt lets the bootloader run server side and thus hits this bug.

I'm attaching a patch which fixes the use of bootloaders for when creating a domain via SEXPR protocol

Regards,
Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
tools/python/xen/xend/XendConfig.py +1 -0
diff -r 937c821b2310 tools/python/xen/xend/XendConfig.py
@@ -708,6 +708,7 @@ class XendConfig(dict):
                 else:
                     self[sxp_arg] = val
 
+        _set_cfg_if_exists('bootloader')
         _set_cfg_if_exists('shadow_memory')
         _set_cfg_if_exists('security')
         _set_cfg_if_exists('features')
tools/python/xen/xend/XendDomainInfo.py +9 -3
diff -r 937c821b2310 tools/python/xen/xend/XendDomainInfo.py
@@ -1327,7 +1327,7 @@ class XendDomainInfo:
 
         # if we have a boot loader but no image, then we need to set things
         # up by running the boot loader non-interactively
-        if self.info.get('bootloader') and self.info.get('image'):
+        if self.info.get('bootloader'):
             self._configureBootloader()
 
         if not self._infoIsSet('image'):
@@ -1533,11 +1533,17 @@ class XendDomainInfo:
         if not self.info.get('bootloader'):
             return
         blcfg = None
+
         # FIXME: this assumes that we want to use the first disk device
-        for devuuid, (devtype, devinfo) in self.info.all_devices_sxpr():
+        for (devtype, devinfo) in self.info.all_devices_sxpr():
             if not devtype or not devinfo or devtype not in ('vbd', 'tap'):
                 continue
-            disk = devinfo.get('uname')
+            disk = None
+            for param in devinfo:
+                if param[0] == 'uname':
+                    disk = param[1]
+                    break
+
             if disk is None:
                 continue
             fn = blkdev_uname_to_file(disk)

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

Applied
#1 lore raw
Quoted 4 lines · Daniel P. Berrange

I'm attaching a patch which fixes the use of bootloaders for when creating a domain via SEXPR protocol

Thanks Dan,

I've applied these patches to xen-unstable.

Cheers,

Alastair