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 <richardw.y...@linux.intel.com>
---
 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