machine: query mem-merge machine property
Running
qemu-bin ... -machine pc,mem-merge=on
leads to crash:
x86_64-softmmu/qemu-system-x86_64 -machine pc,dump-guest-core=on
qemu-system-x86_64: qemu/util/qemu-option.c:387: qemu_opt_get_bool_helper:
Assertion `opt->desc && opt->desc->type == QEMU_OPT_BOOL' failed. Aborted
(core dumped)
This happens because the commit e79d5a6 ("machine: remove qemu_machine_opts
global list") removed the global option descriptions and moved them to
MachineState's QOM properties.
Fix this by querying machine properties through designated wrappers.
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 8033683..e3a3e2a 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -286,6 +286,7 @@
ms->kernel_irqchip_allowed = true;
ms->kvm_shadow_mem = -1;
ms->dump_guest_core = true;
+ ms->mem_merge = true;
object_property_add_str(obj, "accel",
machine_get_accel, machine_set_accel, NULL);
@@ -431,6 +432,11 @@
return machine->dump_guest_core;
}
+bool machine_mem_merge(MachineState *machine)
+{
+ return machine->mem_merge;
+}
+
static const TypeInfo machine_info = {
.name = TYPE_MACHINE,
.parent = TYPE_OBJECT,