On Fri, 2015-12-11 at 16:47 +0100, Juergen Gross wrote: > Add a parameter to init-xenstore-domain for support of arbitrary > parameters for the xenstore domain. > > Signed-off-by: Juergen Gross <jgr...@suse.com> > --- > tools/xenstore/init-xenstore-domain.c | 21 ++++++++++++++++----- > 1 file changed, 16 insertions(+), 5 deletions(-) > > diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init- > xenstore-domain.c > index 0ca7eed..eedcf32 100644 > --- a/tools/xenstore/init-xenstore-domain.c > +++ b/tools/xenstore/init-xenstore-domain.c > @@ -17,6 +17,7 @@ static uint32_t domid = -1; > 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 } > }; > > @@ -36,10 +38,11 @@ static void usage(void) > "\n" > "where options may include:\n" > "\n" > -" --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"); > +" --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" > +" --param <cmdline> optional additional parameters for the > domain\n");
This seems spurious, either get the indent right when you add the original block or leave it alone here I think. Otherwise this looks good to me: Acked-by: Ian Campbell <ian.campb...@citrix.com> > } > > 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; > } > } > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel