aboutsummaryrefslogtreecommitdiff
path: root/accel/kvm
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-11-02 09:44:36 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-15 12:51:55 -0500
commitf2ce39b4f067fe8b8de6104a2d8ac558d35c330b (patch)
tree0d6c327eb7b5522347c7f465d403829af4f2ec6e /accel/kvm
parent55810e90cc9a5ca18289c25aa5c1e0e2dc77eadb (diff)
downloadqemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.zip
qemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.tar.gz
qemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.tar.bz2
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')
-rw-r--r--accel/kvm/kvm-all.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index baaa542..666b9ab 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 {