diff options
author | Paolo Bonzini | 2020-11-02 15:44:36 +0100 |
---|---|---|
committer | Paolo Bonzini | 2020-12-15 18:51:55 +0100 |
commit | f2ce39b4f067fe8b8de6104a2d8ac558d35c330b (patch) | |
tree | 0d6c327eb7b5522347c7f465d403829af4f2ec6e /accel/kvm/kvm-all.c | |
parent | ppc/spapr: cleanup -machine pseries,nvdimm=X handling (diff) | |
download | qemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.tar.gz qemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.tar.xz qemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.zip |
vl: make qemu_get_machine_opts static
Machine options can be retrieved as properties of the machine object.
Encourage that by removing the "easy" accessor to machine options.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel/kvm/kvm-all.c')
-rw-r--r-- | accel/kvm/kvm-all.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index baaa54249d..666b9ab96c 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2013,7 +2013,6 @@ static int kvm_init(MachineState *ms) const KVMCapabilityInfo *missing_cap; int ret; int type = 0; - const char *kvm_type; uint64_t dirty_log_manual_caps; s = KVM_STATE(ms->accelerator); @@ -2069,13 +2068,11 @@ static int kvm_init(MachineState *ms) } s->as = g_new0(struct KVMAs, s->nr_as); - kvm_type = qemu_opt_get(qemu_get_machine_opts(), "kvm-type"); - if (mc->kvm_type) { + if (object_property_find(OBJECT(current_machine), "kvm-type")) { + g_autofree char *kvm_type = object_property_get_str(OBJECT(current_machine), + "kvm-type", + &error_abort); type = mc->kvm_type(ms, kvm_type); - } else if (kvm_type) { - ret = -EINVAL; - fprintf(stderr, "Invalid argument kvm-type=%s\n", kvm_type); - goto err; } do { |