Patchwork [11/27] pc: add PC_DEFAULT_CPU_MODEL #define

login
register
mail settings
Submitter Eduardo Habkost
Date Oct. 24, 2012, 5:49 p.m.
Message ID <1351101001-14589-12-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/193909/
State New
Headers show

Comments

Eduardo Habkost - Oct. 24, 2012, 5:49 p.m.
Make the pc_cpus_init() code more clear, by removing an #ifdef from
the middle of the code.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/pc.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index 408823b..67fdbe2 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -71,6 +71,12 @@ 
 #define FW_CFG_E820_TABLE (FW_CFG_ARCH_LOCAL + 3)
 #define FW_CFG_HPET (FW_CFG_ARCH_LOCAL + 4)
 
+#ifdef TARGET_X86_64
+#define PC_DEFAULT_CPU_MODEL "qemu64"
+#else
+#define PC_DEFAULT_CPU_MODEL "qemu32"
+#endif
+
 #define E820_NR_ENTRIES		16
 
 struct e820_entry {
@@ -859,11 +865,7 @@  void pc_cpus_init(const char *cpu_model)
 
     /* init CPUs */
     if (cpu_model == NULL) {
-#ifdef TARGET_X86_64
-        cpu_model = "qemu64";
-#else
-        cpu_model = "qemu32";
-#endif
+        cpu_model = PC_DEFAULT_CPU_MODEL;
     }
 
     for (i = 0; i < smp_cpus; i++) {