All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Xen-devel <xen-devel@lists.xensource.com>
Cc: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: [PATCH] xl: recognize the "extra" entry in the domain config file
Date: Tue, 18 May 2010 15:41:16 -0700	[thread overview]
Message-ID: <4BF3178C.5040909@goop.org> (raw)

"extra" defines extra parameters to be added to the kernel command line,
so append it accordingly.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

diff -r 685972a898a8 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon May 17 17:37:56 2010 -0700
+++ b/tools/libxl/xl_cmdimpl.c	Tue May 18 15:38:38 2010 -0700
@@ -502,14 +502,29 @@
         if (!xlu_cfg_get_long (config, "viridian", &l))
             b_info->u.hvm.viridian = l;
     } else {
-        char *cmdline;
-        if (!xlu_cfg_get_string (config, "root", &buf)) {
-            if (asprintf(&cmdline, "root=%s", buf) < 0) {
-                fprintf(stderr, "Failed to allocate memory in asprintf\n");
-                exit(1);
-            }
-            b_info->u.pv.cmdline = cmdline;
-        }
+	char *cmdline;
+	const char *root, *extra;
+
+	root = NULL;
+	extra = "";
+
+        xlu_cfg_get_string (config, "root", &root);
+        xlu_cfg_get_string (config, "extra", &extra);
+
+	cmdline = NULL;
+
+	if (root) {
+	    if (asprintf(&cmdline, "root=%s %s", root, extra) == -1)
+		cmdline = NULL;
+	} else
+	    cmdline = strdup(extra);
+
+	if ((root || extra) && !cmdline) {
+	    fprintf(stderr, "Failed to allocate memory for cmdline\n");
+	    exit(1);
+	}
+
+	b_info->u.pv.cmdline = cmdline;
         if (!xlu_cfg_get_string (config, "ramdisk", &buf))
             b_info->u.pv.ramdisk = strdup(buf);
     }

                 reply	other threads:[~2010-05-18 22:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BF3178C.5040909@goop.org \
    --to=jeremy@goop.org \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=Vincent.Hanquez@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.