From: Kurt Garloff Subject: Re: domUloader kernel command line arguments? Date: Fri, 10 Mar 2006 13:57:33 +0100 Message-ID: <20060310125733.GD5766@tpkurt.garloff.de> References: <4410E4A5.708@hp.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0512185031==" Return-path: In-Reply-To: <4410E4A5.708@hp.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: John Byrne Cc: xen-devel List-Id: xen-devel@lists.xenproject.org --===============0512185031== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VuQYccsttdhdIfIP" Content-Disposition: inline --VuQYccsttdhdIfIP Content-Type: multipart/mixed; boundary="SWTRyWv/ijrBap1m" Content-Disposition: inline --SWTRyWv/ijrBap1m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi John, On Thu, Mar 09, 2006 at 06:29:57PM -0800, John Byrne wrote: > domUloader potentially makes my life a lot easier, but from experiments= =20 > and looking at the code, it doesn't seem like there is any way to pass=20 > kernel command line arguments with it. Am I just missing something? No, it has been an oversight on the way domUloader was integrated into xen. The XendBootloader assumes that the bootloader would pass the kernel command line parameters back as (arg ...). domUloader does not do that, as it does not use an external configuration file where these would be specified. Attached patch addresses this: If the bootloader does NOT return anything as args, the values from the config file (ip, boot, extra) will be filled in. You need to apply this on top of the other domUloader patches. Let me know if this addresses your problem. Best, --=20 Kurt Garloff, Head Architect Linux, Novell Inc. --SWTRyWv/ijrBap1m Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="xen-create-args.diff" Content-Transfer-Encoding: quoted-printable =46rom: 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 =3D None config =3D self.sxpr() + # save filled in values ip, root, args + image=3D sxp.child_value(config, "image") + ip =3D sxp.child_value(image, "ip") + root =3D sxp.child_value(image, "root") + args =3D sxp.child_value(image, "args") + log.debug("bootloader: saved (ip %s) (root %s) (args %s)" \ + % (ip, root, args)) + # Look for disks devices =3D sxp.children(config, "device") # bootloader expects disks in config file format: # [(uname, dev, mode, backend), (...), ...] @@ -1532,6 +1540,16 @@ class XendDomainInfo: msg =3D "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'] =3D sxp.to_string(blcfg) =20 =20 --- 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") =20 - return bootloader(vals.bootloader, vals.disk, not vals.console_autocon= nect, - vals.vcpus, vals.bootentry, vals.root) + config_image =3D bootloader(vals.bootloader, vals.disk,=20 + 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 =3D strip('ip=3D', vals.cmdline_ip) + config_image.append(['ip', cmdline_ip]) + if vals.root: + cmdline_root =3D strip('root=3D', vals.root) + config_image.append(['root', cmdline_root]) + if vals.extra: + config_image.append(['args', vals.extra]) + return config_image =20 def make_config(vals): """Create the domain configuration. --SWTRyWv/ijrBap1m-- --VuQYccsttdhdIfIP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFEEXe9xmLh6hyYd04RApAdAJ0d6xhWuI5X0ALb/rl5ls169DB6GQCg2WiJ JR2tHMp6Toh6goNEpCLbVWU= =OtPL -----END PGP SIGNATURE----- --VuQYccsttdhdIfIP-- --===============0512185031== 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 --===============0512185031==--