All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix domain creation with bootloaders
@ 2006-12-07  1:20 Daniel P. Berrange
  2006-12-07 11:54 ` Alastair Tse
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2006-12-07  1:20 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

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

   Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

Regards,
Dan.
-- 
|=- 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  -=| 

[-- Attachment #2: xen-3.0.4-bootloader.patch --]
[-- Type: text/plain, Size: 1830 bytes --]

diff -r 937c821b2310 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py	Wed Dec 06 20:03:53 2006 -0500
+++ b/tools/python/xen/xend/XendConfig.py	Wed Dec 06 20:03:58 2006 -0500
@@ -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')
diff -r 937c821b2310 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Wed Dec 06 20:03:53 2006 -0500
+++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Dec 06 20:08:24 2006 -0500
@@ -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)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-07 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-07  1:20 [PATCH] Fix domain creation with bootloaders Daniel P. Berrange
2006-12-07 11:54 ` Alastair Tse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.