Patchwork [2/3] pc: use old default cpu type for 0.14 and 0.15 compat machines

login
register
mail settings
Submitter Alexander Graf
Date June 14, 2011, 3:29 p.m.
Message ID <1308065389-11945-3-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/100361/
State New
Headers show

Comments

Alexander Graf - June 14, 2011, 3:29 p.m.
When running with the 0.14 or 0.15 machine types, use the old mechanism
of determining the default CPU to choose, so that the guest sees the same
default CPU when running qemu in compat mode.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/pc_piix.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 3b3ef84..84d5650 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -220,6 +220,14 @@  static void pc_init_pci_014(ram_addr_t ram_size,
                             const char *initrd_filename,
                             const char *cpu_model)
 {
+    if (cpu_model == NULL) {
+#ifdef TARGET_X86_64
+        cpu_model = "qemu64";
+#else
+        cpu_model = "qemu32";
+#endif
+    }
+
     pc_init1(ram_size, boot_device,
              kernel_filename, kernel_cmdline,
              initrd_filename, cpu_model, 1, 1);
@@ -232,6 +240,14 @@  static void pc_init_pci_no_kvmclock(ram_addr_t ram_size,
                                     const char *initrd_filename,
                                     const char *cpu_model)
 {
+    if (cpu_model == NULL) {
+#ifdef TARGET_X86_64
+        cpu_model = "qemu64";
+#else
+        cpu_model = "qemu32";
+#endif
+    }
+
     pc_init1(ram_size, boot_device,
              kernel_filename, kernel_cmdline,
              initrd_filename, cpu_model, 1, 0);