[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/31] vl.c: add HMP help to machine
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 05/31] vl.c: add HMP help to machine |
Date: |
Tue, 23 Dec 2014 13:54:01 +0000 |
From: Marcel Apfelbaum <address@hidden>
The help is based on the actual machine properties
exposing only the relevant options.
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>
Reviewed-by: Greg Bellows <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
vl.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/vl.c b/vl.c
index fa7a02c..bea9656 100644
--- a/vl.c
+++ b/vl.c
@@ -1423,6 +1423,31 @@ MachineInfoList *qmp_query_machines(Error **errp)
return mach_list;
}
+static int machine_help_func(QemuOpts *opts, MachineState *machine)
+{
+ ObjectProperty *prop;
+
+ if (!qemu_opt_has_help_opt(opts)) {
+ return 0;
+ }
+
+ QTAILQ_FOREACH(prop, &OBJECT(machine)->properties, node) {
+ if (!prop->set) {
+ continue;
+ }
+
+ error_printf("%s.%s=%s", MACHINE_GET_CLASS(machine)->name,
+ prop->name, prop->type);
+ if (prop->description) {
+ error_printf(" (%s)\n", prop->description);
+ } else {
+ error_printf("\n");
+ }
+ }
+
+ return 1;
+}
+
/***********************************************************/
/* main execution loop */
@@ -3758,6 +3783,9 @@ int main(int argc, char **argv, char **envp)
current_machine = MACHINE(object_new(object_class_get_name(
OBJECT_CLASS(machine_class))));
+ if (machine_help_func(qemu_get_machine_opts(), current_machine)) {
+ exit(0);
+ }
object_property_add_child(object_get_root(), "machine",
OBJECT(current_machine), &error_abort);
cpu_exec_init_all();
--
1.9.1
- [Qemu-devel] [PULL 27/31] fw_cfg_mem: expose the "data_width" property with fw_cfg_init_mem_wide(), (continued)
- [Qemu-devel] [PULL 27/31] fw_cfg_mem: expose the "data_width" property with fw_cfg_init_mem_wide(), Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 29/31] hw/loader: split out load_image_gzipped_buffer(), Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 24/31] fw_cfg_mem: flip ctl_mem_ops and data_mem_ops to DEVICE_BIG_ENDIAN, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 22/31] fw_cfg: move boards to fw_cfg_init_io() / fw_cfg_init_mem(), Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 18/31] target-arm: Breakout integratorcp and versatilepb cpu init, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 16/31] target-arm: Enable CPU has_el3 prop during VE init, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 07/31] target-arm: Add vexpress a9 & a15 machine objects, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 19/31] target-arm: Disable EL3 on unsupported machines, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 06/31] target-arm: Add vexpress class and machine types, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 11/31] target-arm: Add virt class and machine types, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 05/31] vl.c: add HMP help to machine,
Peter Maydell <=
- [Qemu-devel] [PULL 04/31] vl.c: simplified machine_set_property, Peter Maydell, 2014/12/23
- [Qemu-devel] [PULL 21/31] fw_cfg: hard separation between the MMIO and I/O port mappings, Peter Maydell, 2014/12/23
- Re: [Qemu-devel] [PULL 00/31] target-arm queue, Peter Maydell, 2014/12/23