diff options
-rw-r--r-- | target/i386/kvm.c | 9 | ||||
-rw-r--r-- | target/i386/machine.c | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/target/i386/kvm.c b/target/i386/kvm.c index c931e9d..e4b4f57 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1640,9 +1640,14 @@ int kvm_arch_init_vcpu(CPUState *cs) !!(c->ecx & CPUID_EXT_SMX); } - if (cpu_has_nested_virt(env) && !nested_virt_mig_blocker) { + if (cpu_has_vmx(env) && !nested_virt_mig_blocker && + ((kvm_max_nested_state_length() <= 0) || !has_exception_payload)) { error_setg(&nested_virt_mig_blocker, - "Nested virtualization does not support live migration yet"); + "Kernel do not provide required capabilities for " + "nested virtualization migration. " + "(CAP_NESTED_STATE=%d, CAP_EXCEPTION_PAYLOAD=%d)", + kvm_max_nested_state_length() > 0, + has_exception_payload); r = migrate_add_blocker(nested_virt_mig_blocker, &local_err); if (local_err) { error_report_err(local_err); diff --git a/target/i386/machine.c b/target/i386/machine.c index fc49e5a..851b249 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -233,7 +233,7 @@ static int cpu_pre_save(void *opaque) #ifdef CONFIG_KVM /* Verify we have nested virtualization state from kernel if required */ - if (cpu_has_nested_virt(env) && !env->nested_state) { + if (kvm_enabled() && cpu_has_vmx(env) && !env->nested_state) { error_report("Guest enabled nested virtualization but kernel " "does not support saving of nested state"); return -EINVAL; |