From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: [PATCH] Fix domain creation with bootloaders Date: Thu, 7 Dec 2006 01:20:38 +0000 Message-ID: <20061207012038.GI13126@redhat.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="BRE3mIcgqKzpedwo" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --BRE3mIcgqKzpedwo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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 -=| --BRE3mIcgqKzpedwo Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xen-3.0.4-bootloader.patch" 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) --BRE3mIcgqKzpedwo Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --BRE3mIcgqKzpedwo--