ia64/xen-unstable

changeset 9030:af6a564ea81c

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 <katzj@redhat.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Feb 26 10:55:21 2006 +0100 (2006-02-26)
parents c7550ed2ccbf
children 5541ea99106a
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Sun Feb 26 10:54:06 2006 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Sun Feb 26 10:55:21 2006 +0100
     1.3 @@ -1502,15 +1502,14 @@ class XendDomainInfo:
     1.4          if not self.info['bootloader']:
     1.5              return
     1.6          # if we're restarting with a bootloader, we need to run it
     1.7 -        # FIXME: this assumes the disk is the first device and
     1.8 -        # that we're booting from the first disk
     1.9          blcfg = None
    1.10          config = self.sxpr()
    1.11          # FIXME: this assumes that we want to use the first disk
    1.12 -        dev = sxp.child_value(config, "device")
    1.13 -        if dev:
    1.14 -            disk = sxp.child_value(dev, "uname")
    1.15 -            fn = blkdev_uname_to_file(disk)
    1.16 +        for dev in sxp.children(config, "device"):
    1.17 +            disk = sxp.child(dev, "vbd")
    1.18 +            if disk is None:
    1.19 +                continue
    1.20 +            fn = blkdev_uname_to_file(sxp.child_value(disk, "uname"))
    1.21              blcfg = bootloader(self.info['bootloader'], fn, 1,
    1.22                                 self.info['vcpus'])
    1.23          if blcfg is None: