WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Instead of relying on xm create to always run the bootlo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Instead of relying on xm create to always run the bootloader, make sure
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 Apr 2006 16:14:10 +0000
Delivery-date: Fri, 28 Apr 2006 09:15:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID ef6216b43278b0e9d55e79de3af9ade060857399
# Parent  268e45409ecdf6a40167a799d7ea91f5bcd6cb8f
Instead of relying on xm create to always run the bootloader, make sure
we run it if we get into domain creation with a bootloader set but no
image.  This could happen if someone creates a domain config via the
XML-RPC or sxp interfaces.

Signed-off-by: Jeremy Katz <katzj@xxxxxxxxxx>

diff -r 268e45409ecd -r ef6216b43278 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Apr 28 14:10:59 2006 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Apr 28 14:11:57 2006 +0100
@@ -1234,6 +1234,11 @@ class XendDomainInfo:
                   self.domid,
                   self.info['cpu_weight'])
 
+        # 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.infoIsSet('bootloader') and not self.infoIsSet('image'):
+            self.configure_bootloader()
+
         if not self.infoIsSet('image'):
             raise VmError('Missing image in configuration')
 
@@ -1613,23 +1618,25 @@ class XendDomainInfo:
 
 
     def configure_bootloader(self):
+        """Run the bootloader if we're configured to do so."""
         if not self.info['bootloader']:
             return
-        # if we're restarting with a bootloader, we need to run it
         blcfg = None
-        config = self.sxpr()
-        # FIXME: this assumes that we want to use the first disk
-        for dev in sxp.children(config, "device"):
-            disk = sxp.child(dev, "vbd")
+        # FIXME: this assumes that we want to use the first disk device
+        for (n,c) in self.info['device']:
+            if not n or not c or n != "vbd":
+                continue
+            disk = sxp.child_value(c, "uname")
             if disk is None:
                 continue
-            fn = blkdev_uname_to_file(sxp.child_value(disk, "uname"))
+            fn = blkdev_uname_to_file(disk)
             blcfg = bootloader(self.info['bootloader'], fn, 1)
+            break
         if blcfg is None:
             msg = "Had a bootloader specified, but can't find disk"
             log.error(msg)
             raise VmError(msg)
-        self.info['image'] = sxp.to_string(blcfg)
+        self.info['image'] = blcfg
 
 
     def send_sysrq(self, key):

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Instead of relying on xm create to always run the bootloader, make sure, Xen patchbot -unstable <=