From: Kurt Garloff Subject: Command line parameters with domUloader.py The bootloader framework expected the bootloader to return kernel command line paramters as (args '...'). pygrub does this, but domUloader does not have such info. Thus fill in ip,root,args in case it has been left empty by the bootloader. Also make sure, these values survive a reboot. Signed-off-by: Kurt Garloff --- xen/xend/XendDomainInfo.py.orig 2006-02-27 17:03:06.000000000 +0100 +++ xen/xend/XendDomainInfo.py 2006-03-07 10:03:31.000000000 +0100 @@ -1507,6 +1507,14 @@ class XendDomainInfo: # if we're restarting with a bootloader, we need to run it blcfg = None config = self.sxpr() + # save filled in values ip, root, args + image= sxp.child_value(config, "image") + ip = sxp.child_value(image, "ip") + root = sxp.child_value(image, "root") + args = sxp.child_value(image, "args") + log.debug("bootloader: saved (ip %s) (root %s) (args %s)" \ + % (ip, root, args)) + # Look for disks devices = sxp.children(config, "device") # bootloader expects disks in config file format: # [(uname, dev, mode, backend), (...), ...] @@ -1532,6 +1540,16 @@ class XendDomainInfo: msg = "Had a bootloader specified, but can't find disk" log.error(msg) raise VmError(msg) + # If bootloader has not filled in args, used saved values + # see xm/create.py: run_bootloader(). + if sxp.child_value(blcfg, "args") is None: + if ip: + blcfg.append(['ip', ip]) + if root: + blcfg.append(['root', root]) + if args: + blcfg.append(['args', args]) + self.info['image'] = sxp.to_string(blcfg) --- xen/xm/create.py.orig 2006-02-27 17:03:06.000000000 +0100 +++ xen/xm/create.py 2006-03-07 09:17:57.000000000 +0100 @@ -563,8 +563,21 @@ def run_bootloader(vals): if not vals.disk: err("No disks configured and boot loader requested") - return bootloader(vals.bootloader, vals.disk, not vals.console_autoconnect, - vals.vcpus, vals.bootentry, vals.root) + config_image = bootloader(vals.bootloader, vals.disk, + not vals.console_autoconnect, + vals.vcpus, vals.bootentry, vals.root) + # If bootloader does not fill in "args", we should use the + # values from the config file. + if sxp.child_value(config_image, "args") is None: + if vals.cmdline_ip: + cmdline_ip = strip('ip=', vals.cmdline_ip) + config_image.append(['ip', cmdline_ip]) + if vals.root: + cmdline_root = strip('root=', vals.root) + config_image.append(['root', cmdline_root]) + if vals.extra: + config_image.append(['args', vals.extra]) + return config_image def make_config(vals): """Create the domain configuration.