Patchwork [v4,09/10] qemu-kvm: Move kvm_set_boot_cpu_id

login
register
mail settings
Submitter Jan Kiszka
Date March 1, 2010, 5:17 p.m.
Message ID <2ac30025621947dfc72bcffac09bcf54d236fd26.1267463833.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/46567/
State New
Headers show

Comments

Jan Kiszka - March 1, 2010, 5:17 p.m.
Setting the boot CPU ID is arch-specific KVM stuff. So push it where it
belongs to.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/pc.c        |    3 ---
 qemu-kvm-x86.c |    3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index 58c32ea..d819fca 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -839,9 +839,6 @@  static void pc_init1(ram_addr_t ram_size,
 #endif
     }
 
-    if (kvm_enabled()) {
-        kvm_set_boot_cpu_id(0);
-    }
     for (i = 0; i < smp_cpus; i++) {
         env = pc_new_cpu(cpu_model);
     }
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 0efa700..7a5925a 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -695,7 +695,8 @@  int kvm_arch_qemu_create_context(void)
     if (kvm_check_extension(kvm_state, KVM_CAP_ADJUST_CLOCK))
         vmstate_register(0, &vmstate_kvmclock, &kvmclock_data);
 #endif
-    return 0;
+
+    return kvm_set_boot_cpu_id(0);
 }
 
 static void set_msr_entry(struct kvm_msr_entry *entry, uint32_t index,