diff options
author | Akihiko Odaki <akihiko.odaki@daynix.com> | 2023-08-22 17:31:02 +0100 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2023-08-24 18:43:47 +0300 |
commit | 34808d041caa3b63c2967a36dea9893083d3327c (patch) | |
tree | a252e47036adcee59a9f0548ea197c2525eac8ce /accel/kvm | |
parent | 01f6417f1550fed6c458fbb49a25db3764dd8008 (diff) | |
download | qemu-34808d041caa3b63c2967a36dea9893083d3327c.zip qemu-34808d041caa3b63c2967a36dea9893083d3327c.tar.gz qemu-34808d041caa3b63c2967a36dea9893083d3327c.tar.bz2 |
kvm: Introduce kvm_arch_get_default_type hook
kvm_arch_get_default_type() returns the default KVM type. This hook is
particularly useful to derive a KVM type that is valid for "none"
machine model, which is used by libvirt to probe the availability of
KVM.
For MIPS, the existing mips_kvm_type() is reused. This function ensures
the availability of VZ which is mandatory to use KVM on the current
QEMU.
Cc: qemu-stable@nongnu.org
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-id: 20230727073134.134102-2-akihiko.odaki@daynix.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: added doc comment for new function]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit 5e0d65909c6f335d578b90491e165440c99adf81)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'accel/kvm')
-rw-r--r-- | accel/kvm/kvm-all.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 7b3da8d..b472301 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2458,7 +2458,7 @@ static int kvm_init(MachineState *ms) KVMState *s; const KVMCapabilityInfo *missing_cap; int ret; - int type = 0; + int type; uint64_t dirty_log_manual_caps; qemu_mutex_init(&kml_slots_lock); @@ -2523,6 +2523,8 @@ static int kvm_init(MachineState *ms) type = mc->kvm_type(ms, kvm_type); } else if (mc->kvm_type) { type = mc->kvm_type(ms, NULL); + } else { + type = kvm_arch_get_default_type(ms); } do { |