@@ -827,6 +827,11 @@ Send debug I<keys> to Xen. It is the same as pressing the Xen
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<get-parameters> I<params>
+
+Get hypervisor parameters as specified in I<params>. This allows for some
+boot parameters of the hypervisor to be read in the running systems.
+
=item B<dmesg> [I<OPTIONS>]
Reads the Xen message buffer, similar to dmesg on a Linux system. The
@@ -219,6 +219,7 @@ int main_psr_mba_set(int argc, char **argv);
int main_psr_mba_show(int argc, char **argv);
#endif
int main_qemu_monitor_command(int argc, char **argv);
+int main_get_parameters(int argc, char **argv);
void help(const char *command);
@@ -662,6 +662,11 @@ struct cmd_spec cmd_table[] = {
"Issue a qemu monitor command to the device model of a domain",
"<Domain> <Command>",
},
+ { "get-parameters",
+ &main_get_parameters, 0, 1,
+ "Get hypervisor parameters",
+ "<Params>",
+ },
};
int cmdtable_len = sizeof(cmd_table)/sizeof(struct cmd_spec);
@@ -364,6 +364,31 @@ int main_config_update(int argc, char **argv)
return 0;
}
+int main_get_parameters(int argc, char **argv)
+{
+ int opt, ret;
+ char *params;
+ char values[1023];
+
+ SWITCH_FOREACH_OPT(opt, "", NULL, "get-parameters", 1) {
+ /* No options */
+ }
+
+ params = argv[optind];
+
+ if (!params) {
+ fprintf(stderr, "no parameter specified\n");
+ return EXIT_FAILURE;
+ }
+ else if ((ret = libxl_get_parameters(ctx, params, values))) {
+ fprintf(stderr, "cannot get parameters: %s : %d\n", params, ret);
+ fprintf(stderr, "Use \"xl dmesg\" to look for possible reason.\n");
+ return EXIT_FAILURE;
+ }
+ fprintf(stderr, "%s : %s\n", params, values);
+
+ return EXIT_SUCCESS;
+}
/*
* Local variables:
* mode: C
Add a new xl command "get-parameters" to get hypervisor runtime parameters. Examples: xl get-parameters "gnttab_max_frames gnttab_max_maptrack_frames" gnttab_max_frames gnttab_max_maptrack_frames : 64 1024 xl set-parameters gnttab_max_frames=128 xl get-parameters gnttab_max_frames gnttab_max_frames : 128 xl get-parameters "gnttab_max_frames gnttab_max_maptrack_frames" gnttab_max_frames gnttab_max_maptrack_frames : 128 1024 Signed-off-by: Vasilis Liaskovitis <vliaskovitis@suse.com> --- docs/man/xl.1.pod.in | 5 +++++ tools/xl/xl.h | 1 + tools/xl/xl_cmdtable.c | 5 +++++ tools/xl/xl_misc.c | 25 +++++++++++++++++++++++++ 4 files changed, 36 insertions(+)