From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: [PATCH v2 10/13] xenstore: add init-xenstore-domain parameter to specify cmdline Date: Fri, 18 Dec 2015 14:14:28 +0100 Message-ID: <1450444471-6454-11-git-send-email-jgross@suse.com> References: <1450444471-6454-1-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1450444471-6454-1-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org, Ian.Campbell@citrix.com, ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com, wei.liu2@citrix.com, dgdegra@tycho.nsa.gov Cc: Juergen Gross List-Id: xen-devel@lists.xenproject.org Add a parameter to init-xenstore-domain for support of arbitrary parameters for the xenstore domain. Signed-off-by: Juergen Gross Acked-by: Ian Campbell Acked-by: Daniel De Graaf --- tools/helpers/init-xenstore-domain.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c index 4cd9e0f..7d875db 100644 --- a/tools/helpers/init-xenstore-domain.c +++ b/tools/helpers/init-xenstore-domain.c @@ -17,6 +17,7 @@ static uint32_t domid = ~0; static char *kernel; static char *ramdisk; static char *flask; +static char *param; static int memory; static struct option options[] = { @@ -24,6 +25,7 @@ static struct option options[] = { { "memory", 1, NULL, 'm' }, { "flask", 1, NULL, 'f' }, { "ramdisk", 1, NULL, 'r' }, + { "param", 1, NULL, 'p' }, { NULL, 0, NULL, 0 } }; @@ -39,7 +41,8 @@ static void usage(void) " --kernel kernel file of the xenstore domain, mandatory\n" " --memory size of the domain in MB, mandatory\n" " --flask optional flask label of the domain\n" -" --ramdisk optional ramdisk file for the domain\n"); +" --ramdisk optional ramdisk file for the domain\n" +" --param optional additional parameters for the domain\n"); } static int build(xc_interface *xch) @@ -93,7 +96,12 @@ static int build(xc_interface *xch) fprintf(stderr, "Xenbus setup ioctl failed\n"); goto err; } - snprintf(cmdline, 512, "--event %d --internal-db", rv); + + if (param) + snprintf(cmdline, 512, "--event %d --internal-db %s", rv, + param); + else + snprintf(cmdline, 512, "--event %d --internal-db", rv); dom = xc_dom_allocate(xch, cmdline, NULL); rv = xc_dom_kernel_file(dom, kernel); @@ -203,6 +211,9 @@ int main(int argc, char** argv) case 'r': ramdisk = optarg; break; + case 'p': + param = optarg; + break; default: usage(); return 2; -- 2.6.2