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

Submitted by Alexander Graf on June 14, 2011, 3:29 p.m.

Details

Message ID 1308065389-11945-3-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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);