aboutsummaryrefslogtreecommitdiff
path: root/target/i386/machine.c
diff options
context:
space:
mode:
authorLiran Alon <liran.alon@oracle.com>2019-06-19 19:21:40 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2019-06-21 13:25:28 +0200
commit12604092e26cdace44c901bc429e7e4c7c3e0cab (patch)
tree3a8d40da683affc6572a414c99fc88f81dd07d55 /target/i386/machine.c
parentfd13f23b8c95311eff74426921557eee592b0ed3 (diff)
target/i386: kvm: Add nested migration blocker only when kernel lacks required capabilities
Previous commits have added support for migration of nested virtualization workloads. This was done by utilising two new KVM capabilities: KVM_CAP_NESTED_STATE and KVM_CAP_EXCEPTION_PAYLOAD. Both which are required in order to correctly migrate such workloads. Therefore, change code to add a migration blocker for vCPUs exposed with Intel VMX or AMD SVM in case one of these kernel capabilities is missing. Signed-off-by: Liran Alon <liran.alon@oracle.com> Reviewed-by: Maran Wilson <maran.wilson@oracle.com> Message-Id: <20190619162140.133674-11-liran.alon@oracle.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/machine.c')
-rw-r--r--target/i386/machine.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/i386/machine.c b/target/i386/machine.c
index fc49e5ad94..851b249d1a 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;