]> git.proxmox.com Git - mirror_qemu.git/commitdiff
machine: query kvm-shadow-mem machine property
authorMarcel Apfelbaum <marcel@redhat.com>
Wed, 4 Feb 2015 15:43:52 +0000 (17:43 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 11 Mar 2015 17:16:25 +0000 (18:16 +0100)
Commit e79d5a6 ("machine: remove qemu_machine_opts global list") removed
the global option descriptions and moved them to MachineState's QOM
properties.

Query kvm-shadow-mem by accessing 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>
hw/core/machine.c
include/hw/boards.h
target-i386/kvm.c

index e04e5ab330c82eab2fc89e618a9e0cf2184226fc..0ad5b12781c368a59b4f60f5897904f0cc8bdd69 100644 (file)
@@ -284,6 +284,7 @@ static void machine_initfn(Object *obj)
     MachineState *ms = MACHINE(obj);
 
     ms->kernel_irqchip_allowed = true;
+    ms->kvm_shadow_mem = -1;
 
     object_property_add_str(obj, "accel",
                             machine_get_accel, machine_set_accel, NULL);
@@ -414,6 +415,11 @@ bool machine_kernel_irqchip_required(MachineState *machine)
     return machine->kernel_irqchip_required;
 }
 
+int machine_kvm_shadow_mem(MachineState *machine)
+{
+    return machine->kvm_shadow_mem;
+}
+
 static const TypeInfo machine_info = {
     .name = TYPE_MACHINE,
     .parent = TYPE_OBJECT,
index 69ab6069643f6d985f4a40b81ce336508dcf1b22..4be3cd1416303fbc7b75653993d455e8f1774959 100644 (file)
@@ -69,6 +69,7 @@ bool machine_usb(MachineState *machine);
 bool machine_iommu(MachineState *machine);
 bool machine_kernel_irqchip_allowed(MachineState *machine);
 bool machine_kernel_irqchip_required(MachineState *machine);
+int machine_kvm_shadow_mem(MachineState *machine);
 
 /**
  * MachineClass:
index ce554e4665a3c966c0fdb0ebda97186de7ada062..acb68310281f1d59e07212d59c925ebda0e8d403 100644 (file)
@@ -890,8 +890,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
     }
     qemu_register_reset(kvm_unpoison_all, NULL);
 
-    shadow_mem = qemu_opt_get_size(qemu_get_machine_opts(),
-                                   "kvm_shadow_mem", -1);
+    shadow_mem = machine_kvm_shadow_mem(ms);
     if (shadow_mem != -1) {
         shadow_mem /= 4096;
         ret = kvm_vm_ioctl(s, KVM_SET_NR_MMU_PAGES, shadow_mem);