From: Jeremy Katz Subject: [PATCH] Fix restarting of domains when using a boot loader Date: Thu, 23 Feb 2006 18:25:19 -0500 Message-ID: <1140737119.3701.10.camel@orodruin.boston.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-9vOs6D2kvhANl2oJwc9n" Return-path: 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 --=-9vOs6D2kvhANl2oJwc9n Content-Type: text/plain Content-Transfer-Encoding: 7bit The disk isn't guaranteed to be the first device in the config sxp -- make sure we can restart domains when using a boot loader even if not. Signed-off-by: Jeremy Katz Jeremy --=-9vOs6D2kvhANl2oJwc9n Content-Disposition: attachment; filename=xen-bl-domain-restart.patch Content-Type: text/x-patch; name=xen-bl-domain-restart.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -r c646586d1065 tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py Thu Feb 23 18:40:08 2006 +0100 +++ b/tools/python/xen/xend/XendDomainInfo.py Thu Feb 23 18:24:17 2006 -0500 @@ -1502,15 +1502,14 @@ class XendDomainInfo: if not self.info['bootloader']: return # if we're restarting with a bootloader, we need to run it - # FIXME: this assumes the disk is the first device and - # that we're booting from the first disk blcfg = None config = self.sxpr() # FIXME: this assumes that we want to use the first disk - dev = sxp.child_value(config, "device") - if dev: - disk = sxp.child_value(dev, "uname") - fn = blkdev_uname_to_file(disk) + for dev in sxp.children(config, "device"): + disk = sxp.child(dev, "vbd") + if disk is None: + continue + fn = blkdev_uname_to_file(sxp.child_value(disk, "uname")) blcfg = bootloader(self.info['bootloader'], fn, 1, self.info['vcpus']) if blcfg is None: --=-9vOs6D2kvhANl2oJwc9n 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 --=-9vOs6D2kvhANl2oJwc9n--