diff mbox

[4/5] Use skeleton of upstream's kvm_arch_init_vcpu()

Message ID 1275395627-2321-5-git-send-email-avi@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Avi Kivity June 1, 2010, 12:33 p.m. UTC
None
diff mbox

Patch

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index f5c76bc..853d50e 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1129,7 +1129,7 @@  static void kvm_trim_features(uint32_t *features, uint32_t supported)
     }
 }
 
-int kvm_arch_init_vcpu(CPUState *env)
+static int _kvm_arch_init_vcpu(CPUState *env)
 {
     struct kvm_cpuid_entry2 cpuid_ent[100];
 #ifdef KVM_CPUID_SIGNATURE
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index ac9e17b..8db6d54 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -163,10 +163,13 @@  static int get_para_features(CPUState *env)
 }
 #endif
 
-#ifdef KVM_UPSTREAM
+static int _kvm_arch_init_vcpu(CPUState *env);
 
 int kvm_arch_init_vcpu(CPUState *env)
 {
+    int r;
+#ifdef KVM_UPSTREAM
+
     struct {
         struct kvm_cpuid2 cpuid;
         struct kvm_cpuid_entry2 entries[100];
@@ -178,6 +181,15 @@  int kvm_arch_init_vcpu(CPUState *env)
     uint32_t signature[3];
 #endif
 
+#endif
+
+    r = _kvm_arch_init_vcpu(env);
+    if (r < 0) {
+        return r;
+    }
+
+#ifdef KVM_UPSTREAM
+
     env->mp_state = KVM_MP_STATE_RUNNABLE;
 
     env->cpuid_features &= kvm_arch_get_supported_cpuid(env, 1, R_EDX);
@@ -273,9 +285,10 @@  int kvm_arch_init_vcpu(CPUState *env)
     cpuid_data.cpuid.nent = cpuid_i;
 
     return kvm_vcpu_ioctl(env, KVM_SET_CPUID2, &cpuid_data);
+#endif
+    return 0;
 }
 
-#endif
 void kvm_arch_reset_vcpu(CPUState *env)
 {
     env->exception_injected = -1;