qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] target/i386: return directly from hyperv_init_vcpu() if hyperv n


From: Wei Yang
Subject: [PATCH] target/i386: return directly from hyperv_init_vcpu() if hyperv not enabled
Date: Fri, 1 Nov 2019 09:45:28 +0800

If hyperv is not enabled, related features are not set or enabled.

No extra work to do, return directly.

---
First time touch hyperv, hope my understanding is correct.

Signed-off-by: Wei Yang <address@hidden>
---
 target/i386/kvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index bfd09bd441..6532904f0c 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1365,6 +1365,9 @@ static int hyperv_init_vcpu(X86CPU *cpu)
     Error *local_err = NULL;
     int ret;
 
+    if (!hyperv_enabled(cpu))
+        return 0;
+
     if (cpu->hyperv_passthrough && hv_passthrough_mig_blocker == NULL) {
         error_setg(&hv_passthrough_mig_blocker,
                    "'hv-passthrough' CPU flag prevents migration, use explicit"
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]