From: Juergen Gross Date: Mon, 28 Aug 2017 07:37:00 +0000 (+0200) Subject: xl: add new xl command set-parameters X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1544 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c7047a65575f7c0cf3a1240c3cbc760d482d9e07;p=xen.git xl: add new xl command set-parameters Add a new xl command "set-parameters" to set hypervisor parameters at runtime similar to boot time parameters via command line. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- diff --git a/docs/man/xl.pod.1.in b/docs/man/xl.pod.1.in index 16c83066fe..3d5f2f7359 100644 --- a/docs/man/xl.pod.1.in +++ b/docs/man/xl.pod.1.in @@ -822,6 +822,11 @@ Pass the VNC password to vncviewer via stdin. Send debug I to Xen. It is the same as pressing the Xen "conswitch" (Ctrl-A by default) three times and then pressing "keys". +=item B I + +Set hypervisor parameters as specified in I. This allows for some +boot parameters of the hypervisor to be modified in the running systems. + =item B [I] Reads the Xen message buffer, similar to dmesg on a Linux system. The diff --git a/tools/xl/xl.h b/tools/xl/xl.h index aa95b77146..5d3d2a4835 100644 --- a/tools/xl/xl.h +++ b/tools/xl/xl.h @@ -154,6 +154,7 @@ int main_rename(int argc, char **argv); int main_trigger(int argc, char **argv); int main_sysrq(int argc, char **argv); int main_debug_keys(int argc, char **argv); +int main_set_parameters(int argc, char **argv); int main_dmesg(int argc, char **argv); int main_top(int argc, char **argv); int main_networkattach(int argc, char **argv); diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c index 2c71a9f776..ba0159df67 100644 --- a/tools/xl/xl_cmdtable.c +++ b/tools/xl/xl_cmdtable.c @@ -309,6 +309,11 @@ struct cmd_spec cmd_table[] = { "Send debug keys to Xen", "", }, + { "set-parameters", + &main_set_parameters, 0, 1, + "Set hypervisor parameters", + "", + }, { "dmesg", &main_dmesg, 0, 0, "Read and/or clear dmesg buffer", diff --git a/tools/xl/xl_misc.c b/tools/xl/xl_misc.c index 9c6227af23..dcf940a6d4 100644 --- a/tools/xl/xl_misc.c +++ b/tools/xl/xl_misc.c @@ -155,6 +155,26 @@ int main_debug_keys(int argc, char **argv) return EXIT_SUCCESS; } +int main_set_parameters(int argc, char **argv) +{ + int opt; + char *params; + + SWITCH_FOREACH_OPT(opt, "", NULL, "set-parameters", 1) { + /* No options */ + } + + params = argv[optind]; + + if (libxl_set_parameters(ctx, params)) { + fprintf(stderr, "cannot set parameters: %s\n", params); + fprintf(stderr, "Use \"xl dmesg\" to look for possible reason.\n"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} + int main_devd(int argc, char **argv) { int ret = 0, opt = 0, daemonize = 1;