mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Merged.
This commit is contained in:
commit
30907c5593
17 files changed
+119
-83
No files matched your search
@@ -19,7 +19,7 @@ import sxp
|
||||
from XendLogging import log
|
||||
from XendError import VmError
|
||||
|
||||
def bootloader(blexec, disk, quiet = 0, blargs = None):
|
||||
def bootloader(blexec, disk, quiet = 0, blargs = None, imgcfg = None):
|
||||
"""Run the boot loader executable on the given disk and return a
|
||||
config image.
|
||||
@param blexec Binary to use as the boot loader
|
||||
@@ -86,4 +86,10 @@ def bootloader(blexec, disk, quiet = 0, blargs = None):
|
||||
pin = sxp.Parser()
|
||||
pin.input(ret)
|
||||
pin.input_eof()
|
||||
return pin.val
|
||||
blcfg = pin.val
|
||||
|
||||
if imgcfg is None:
|
||||
return blcfg
|
||||
else:
|
||||
c = sxp.merge(blcfg, imgcfg)
|
||||
return c
|
||||
@@ -1633,7 +1633,8 @@ class XendDomainInfo:
|
||||
continue
|
||||
fn = blkdev_uname_to_file(disk)
|
||||
blcfg = bootloader(self.info['bootloader'], fn, 1,
|
||||
self.info['bootloader_args'])
|
||||
self.info['bootloader_args'],
|
||||
self.info['image'])
|
||||
break
|
||||
if blcfg is None:
|
||||
msg = "Had a bootloader specified, but can't find disk"
|
||||
|
||||
@@ -94,7 +94,7 @@ class PciController(DevController):
|
||||
|
||||
else:
|
||||
# Xen 2.0 configuration compatibility
|
||||
domain = get_param(dev_config, 'domain', 0)
|
||||
domain = get_param(config, 'domain', 0)
|
||||
bus = get_param(config, 'bus')
|
||||
slot = get_param(config, 'dev')
|
||||
func = get_param(config, 'func')
|
||||
|
||||
@@ -448,8 +448,11 @@ def strip(pre, s):
|
||||
def configure_image(vals):
|
||||
"""Create the image config.
|
||||
"""
|
||||
if not vals.builder:
|
||||
return None
|
||||
config_image = [ vals.builder ]
|
||||
config_image.append([ 'kernel', os.path.abspath(vals.kernel) ])
|
||||
if vals.kernel:
|
||||
config_image.append([ 'kernel', os.path.abspath(vals.kernel) ])
|
||||
if vals.ramdisk:
|
||||
config_image.append([ 'ramdisk', os.path.abspath(vals.ramdisk) ])
|
||||
if vals.cmdline_ip:
|
||||
@@ -616,7 +619,7 @@ def configure_hvm(config_image, vals):
|
||||
if (vals.__dict__[a]):
|
||||
config_image.append([a, vals.__dict__[a]])
|
||||
|
||||
def run_bootloader(vals):
|
||||
def run_bootloader(vals, config_image):
|
||||
if not os.access(vals.bootloader, os.X_OK):
|
||||
err("Bootloader isn't executable")
|
||||
if len(vals.disk) < 1:
|
||||
@@ -630,7 +633,7 @@ def run_bootloader(vals):
|
||||
vals.bootargs = "--entry=%s" %(vals.bootentry,)
|
||||
|
||||
return bootloader(vals.bootloader, file, not vals.console_autoconnect,
|
||||
vals.bootargs)
|
||||
vals.bootargs, config_image)
|
||||
|
||||
def make_config(vals):
|
||||
"""Create the domain configuration.
|
||||
@@ -662,13 +665,12 @@ def make_config(vals):
|
||||
if vals.tpmif:
|
||||
config.append(['backend', ['tpmif']])
|
||||
|
||||
config_image = configure_image(vals)
|
||||
if vals.bootloader:
|
||||
config_image = run_bootloader(vals)
|
||||
config_image = run_bootloader(vals, config_image)
|
||||
config.append(['bootloader', vals.bootloader])
|
||||
if vals.bootargs:
|
||||
config.append(['bootloader_args'], vals.bootargs)
|
||||
else:
|
||||
config_image = configure_image(vals)
|
||||
config.append(['image', config_image])
|
||||
|
||||
config_devs = []
|
||||
|
||||