]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xl: add new xl command set-parameters
authorJuergen Gross <jgross@suse.com>
Mon, 28 Aug 2017 07:37:00 +0000 (09:37 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 28 Aug 2017 08:56:22 +0000 (10:56 +0200)
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 <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
docs/man/xl.pod.1.in
tools/xl/xl.h
tools/xl/xl_cmdtable.c
tools/xl/xl_misc.c

index 16c83066fea345d088c8c2332eb6628c303954b7..3d5f2f7359c23559c1f13b3583e39cc5cb70c0a9 100644 (file)
@@ -822,6 +822,11 @@ Pass the VNC password to vncviewer via stdin.
 Send debug I<keys> to Xen. It is the same as pressing the Xen
 "conswitch" (Ctrl-A by default) three times and then pressing "keys".
 
+=item B<set-parameters> I<params>
+
+Set hypervisor parameters as specified in I<params>. This allows for some
+boot parameters of the hypervisor to be modified in the running systems.
+
 =item B<dmesg> [I<OPTIONS>]
 
 Reads the Xen message buffer, similar to dmesg on a Linux system.  The
index aa95b77146127f826757fd5c32f5fa416f909934..5d3d2a4835eb5bfb8d95ad5eff74721f97d74790 100644 (file)
@@ -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);
index 2c71a9f776bf35fb518e2b7506390394f333245f..ba0159df676216eccb40950b4f6ab0e9a8305d01 100644 (file)
@@ -309,6 +309,11 @@ struct cmd_spec cmd_table[] = {
       "Send debug keys to Xen",
       "<Keys>",
     },
+    { "set-parameters",
+      &main_set_parameters, 0, 1,
+      "Set hypervisor parameters",
+      "<Params>",
+    },
     { "dmesg",
       &main_dmesg, 0, 0,
       "Read and/or clear dmesg buffer",
index 9c6227af234bfaa76abf761bb27412b3c126a76d..dcf940a6d4a630f0376dcd83edd880283a2b14fc 100644 (file)
@@ -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;