From f2ce39b4f067fe8b8de6104a2d8ac558d35c330b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 2 Nov 2020 09:44:36 -0500 Subject: 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 --- accel/kvm/kvm-all.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'accel/kvm/kvm-all.c') 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 { -- cgit v1.2.3-55-g7522