qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 03/31] machine: remove qemu_machine_opts global list
Date: Tue, 23 Dec 2014 13:53:59 +0000	[thread overview]
Message-ID: <1419342867-15527-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1419342867-15527-1-git-send-email-peter.maydell@linaro.org>

From: Marcel Apfelbaum <marcel.a@redhat.com>

QEMU has support for options per machine, keeping
a global list of options is no longer necessary.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Greg Bellows <greg.bellows@linaro.org>
Message-id: 1418217570-15517-2-git-send-email-marcel.a@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/core/machine.c | 45 +++++++++++++++++++++++++++++
 hw/i386/pc.c      |  7 +++++
 hw/ppc/spapr.c    |  3 ++
 vl.c              | 84 ++++---------------------------------------------------
 4 files changed, 61 insertions(+), 78 deletions(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 19d3e3a..a0ae5f9 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -291,48 +291,93 @@ static void machine_initfn(Object *obj)
 
     object_property_add_str(obj, "accel",
                             machine_get_accel, machine_set_accel, NULL);
+    object_property_set_description(obj, "accel",
+                                    "Accelerator list",
+                                    NULL);
     object_property_add_bool(obj, "kernel-irqchip",
                              machine_get_kernel_irqchip,
                              machine_set_kernel_irqchip,
                              NULL);
+    object_property_set_description(obj, "kernel-irqchip",
+                                    "Use KVM in-kernel irqchip",
+                                    NULL);
     object_property_add(obj, "kvm-shadow-mem", "int",
                         machine_get_kvm_shadow_mem,
                         machine_set_kvm_shadow_mem,
                         NULL, NULL, NULL);
+    object_property_set_description(obj, "kvm-shadow-mem",
+                                    "KVM shadow MMU size",
+                                    NULL);
     object_property_add_str(obj, "kernel",
                             machine_get_kernel, machine_set_kernel, NULL);
+    object_property_set_description(obj, "kernel",
+                                    "Linux kernel image file",
+                                    NULL);
     object_property_add_str(obj, "initrd",
                             machine_get_initrd, machine_set_initrd, NULL);
+    object_property_set_description(obj, "initrd",
+                                    "Linux initial ramdisk file",
+                                    NULL);
     object_property_add_str(obj, "append",
                             machine_get_append, machine_set_append, NULL);
+    object_property_set_description(obj, "append",
+                                    "Linux kernel command line",
+                                    NULL);
     object_property_add_str(obj, "dtb",
                             machine_get_dtb, machine_set_dtb, NULL);
+    object_property_set_description(obj, "dtb",
+                                    "Linux kernel device tree file",
+                                    NULL);
     object_property_add_str(obj, "dumpdtb",
                             machine_get_dumpdtb, machine_set_dumpdtb, NULL);
+    object_property_set_description(obj, "dumpdtb",
+                                    "Dump current dtb to a file and quit",
+                                    NULL);
     object_property_add(obj, "phandle-start", "int",
                         machine_get_phandle_start,
                         machine_set_phandle_start,
                         NULL, NULL, NULL);
+    object_property_set_description(obj, "phandle-start",
+                                    "The first phandle ID we may generate dynamically",
+                                    NULL);
     object_property_add_str(obj, "dt-compatible",
                             machine_get_dt_compatible,
                             machine_set_dt_compatible,
                             NULL);
+    object_property_set_description(obj, "dt-compatible",
+                                    "Overrides the \"compatible\" property of the dt root node",
+                                    NULL);
     object_property_add_bool(obj, "dump-guest-core",
                              machine_get_dump_guest_core,
                              machine_set_dump_guest_core,
                              NULL);
+    object_property_set_description(obj, "dump-guest-core",
+                                    "Include guest memory in  a core dump",
+                                    NULL);
     object_property_add_bool(obj, "mem-merge",
                              machine_get_mem_merge,
                              machine_set_mem_merge, NULL);
+    object_property_set_description(obj, "mem-merge",
+                                    "Enable/disable memory merge support",
+                                    NULL);
     object_property_add_bool(obj, "usb",
                              machine_get_usb,
                              machine_set_usb, NULL);
+    object_property_set_description(obj, "usb",
+                                    "Set on/off to enable/disable usb",
+                                    NULL);
     object_property_add_str(obj, "firmware",
                             machine_get_firmware,
                             machine_set_firmware, NULL);
+    object_property_set_description(obj, "firmware",
+                                    "Firmware image",
+                                    NULL);
     object_property_add_bool(obj, "iommu",
                              machine_get_iommu,
                              machine_set_iommu, NULL);
+    object_property_set_description(obj, "iommu",
+                                    "Set on/off to enable/disable Intel IOMMU (VT-d)",
+                                    NULL);
 
     /* Register notifier when init is done for sysbus sanity checks */
     ms->sysbus_notifier.notify = machine_init_notify;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 1ec7290..a3ddb5e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1805,17 +1805,24 @@ static void pc_machine_initfn(Object *obj)
     object_property_add(obj, PC_MACHINE_MEMHP_REGION_SIZE, "int",
                         pc_machine_get_hotplug_memory_region_size,
                         NULL, NULL, NULL, NULL);
+
     pcms->max_ram_below_4g = 1ULL << 32; /* 4G */
     object_property_add(obj, PC_MACHINE_MAX_RAM_BELOW_4G, "size",
                         pc_machine_get_max_ram_below_4g,
                         pc_machine_set_max_ram_below_4g,
                         NULL, NULL, NULL);
+    object_property_set_description(obj, PC_MACHINE_MAX_RAM_BELOW_4G,
+                                    "Maximum ram below the 4G boundary (32bit boundary)",
+                                    NULL);
 
     pcms->vmport = ON_OFF_AUTO_AUTO;
     object_property_add(obj, PC_MACHINE_VMPORT, "OnOffAuto",
                         pc_machine_get_vmport,
                         pc_machine_set_vmport,
                         NULL, NULL, NULL);
+    object_property_set_description(obj, PC_MACHINE_VMPORT,
+                                    "Enable vmport (pc & q35)",
+                                    NULL);
 
     pcms->enforce_aligned_dimm = true;
     object_property_add_bool(obj, PC_MACHINE_ENFORCE_ALIGNED_DIMM,
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 30de25d..08401e0 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1655,6 +1655,9 @@ static void spapr_machine_initfn(Object *obj)
 {
     object_property_add_str(obj, "kvm-type",
                             spapr_get_kvm_type, spapr_set_kvm_type, NULL);
+    object_property_set_description(obj, "kvm-type",
+                                    "Specifies the KVM virtualization mode (HV, PR)",
+                                    NULL);
 }
 
 static void ppc_cpu_do_nmi_on_cpu(void *arg)
diff --git a/vl.c b/vl.c
index a824a7d..7537be4 100644
--- a/vl.c
+++ b/vl.c
@@ -308,84 +308,12 @@ static QemuOptsList qemu_machine_opts = {
     .merge_lists = true,
     .head = QTAILQ_HEAD_INITIALIZER(qemu_machine_opts.head),
     .desc = {
-        {
-            .name = "type",
-            .type = QEMU_OPT_STRING,
-            .help = "emulated machine"
-        }, {
-            .name = "accel",
-            .type = QEMU_OPT_STRING,
-            .help = "accelerator list",
-        }, {
-            .name = "kernel_irqchip",
-            .type = QEMU_OPT_BOOL,
-            .help = "use KVM in-kernel irqchip",
-        }, {
-            .name = "kvm_shadow_mem",
-            .type = QEMU_OPT_SIZE,
-            .help = "KVM shadow MMU size",
-        }, {
-            .name = "kernel",
-            .type = QEMU_OPT_STRING,
-            .help = "Linux kernel image file",
-        }, {
-            .name = "initrd",
-            .type = QEMU_OPT_STRING,
-            .help = "Linux initial ramdisk file",
-        }, {
-            .name = "append",
-            .type = QEMU_OPT_STRING,
-            .help = "Linux kernel command line",
-        }, {
-            .name = "dtb",
-            .type = QEMU_OPT_STRING,
-            .help = "Linux kernel device tree file",
-        }, {
-            .name = "dumpdtb",
-            .type = QEMU_OPT_STRING,
-            .help = "Dump current dtb to a file and quit",
-        }, {
-            .name = "phandle_start",
-            .type = QEMU_OPT_NUMBER,
-            .help = "The first phandle ID we may generate dynamically",
-        }, {
-            .name = "dt_compatible",
-            .type = QEMU_OPT_STRING,
-            .help = "Overrides the \"compatible\" property of the dt root node",
-        }, {
-            .name = "dump-guest-core",
-            .type = QEMU_OPT_BOOL,
-            .help = "Include guest memory in  a core dump",
-        }, {
-            .name = "mem-merge",
-            .type = QEMU_OPT_BOOL,
-            .help = "enable/disable memory merge support",
-        },{
-            .name = "usb",
-            .type = QEMU_OPT_BOOL,
-            .help = "Set on/off to enable/disable usb",
-        },{
-            .name = "firmware",
-            .type = QEMU_OPT_STRING,
-            .help = "firmware image",
-        },{
-            .name = "kvm-type",
-            .type = QEMU_OPT_STRING,
-            .help = "Specifies the KVM virtualization mode (HV, PR)",
-        },{
-            .name = PC_MACHINE_MAX_RAM_BELOW_4G,
-            .type = QEMU_OPT_SIZE,
-            .help = "maximum ram below the 4G boundary (32bit boundary)",
-        }, {
-            .name = PC_MACHINE_VMPORT,
-            .type = QEMU_OPT_STRING,
-            .help = "Enable vmport (pc & q35)",
-        },{
-            .name = "iommu",
-            .type = QEMU_OPT_BOOL,
-            .help = "Set on/off to enable/disable Intel IOMMU (VT-d)",
-        },
-        { /* End of list */ }
+        /*
+         * no elements => accept any
+         * sanity checking will happen later
+         * when setting machine properties
+         */
+        { }
     },
 };
 
-- 
1.9.1

  parent reply	other threads:[~2014-12-23 13:54 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 13:53 [Qemu-devel] [PULL 00/31] target-arm queue Peter Maydell
2014-12-23 13:53 ` [Qemu-devel] [PULL 01/31] audio: Don't free hw resources until after hw backend is stopped Peter Maydell
2014-12-23 13:53 ` [Qemu-devel] [PULL 02/31] target-arm: Merge EL3 CP15 register lists Peter Maydell
2014-12-23 13:53 ` Peter Maydell [this message]
2014-12-23 13:54 ` [Qemu-devel] [PULL 04/31] vl.c: simplified machine_set_property Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 05/31] vl.c: add HMP help to machine Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 06/31] target-arm: Add vexpress class and machine types Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 07/31] target-arm: Add vexpress a9 & a15 machine objects Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 08/31] target-arm: Switch to common vexpress machine init Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 09/31] target-arm: Add vexpress machine secure property Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 10/31] target-arm: Change vexpress daughterboard init arg Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 11/31] target-arm: Add virt class and machine types Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 12/31] target-arm: Add virt machine secure property Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 13/31] target-arm: Add feature unset function Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 14/31] target-arm: Add ARMCPU secure property Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 15/31] target-arm: Add arm_boot_info secure_boot control Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 16/31] target-arm: Enable CPU has_el3 prop during VE init Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 17/31] target-arm: Set CPU has_el3 prop during virt init Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 18/31] target-arm: Breakout integratorcp and versatilepb cpu init Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 19/31] target-arm: Disable EL3 on unsupported machines Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 20/31] target-arm: add cpu feature EL3 to CPUs with Security Extensions Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 21/31] fw_cfg: hard separation between the MMIO and I/O port mappings Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 22/31] fw_cfg: move boards to fw_cfg_init_io() / fw_cfg_init_mem() Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 23/31] fw_cfg_mem: max access size and region size are the same for data register Peter Maydell
2014-12-23 13:54 ` [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 13:54 ` [Qemu-devel] [PULL 25/31] exec: allows 8-byte accesses in subpage_ops Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 26/31] fw_cfg_mem: introduce the "data_width" property Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 27/31] fw_cfg_mem: expose the "data_width" property with fw_cfg_init_mem_wide() Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 28/31] arm: add fw_cfg to "virt" board Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 29/31] hw/loader: split out load_image_gzipped_buffer() Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 30/31] hw/arm: pass pristine kernel image to guest firmware over fw_cfg Peter Maydell
2014-12-23 13:54 ` [Qemu-devel] [PULL 31/31] hw/arm/virt: enable passing of EFI-stubbed kernel to guest UEFI firmware Peter Maydell
2014-12-23 17:46 ` [Qemu-devel] [PULL 00/31] target-arm queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419342867-15527-4-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).