The linux-user qemu help usage doesn't output the default cpu_model in
the usage.  This patch is a minimal code change to output the default
cpu_model.
Index: qemu/linux-user/main.c
===================================================================
--- qemu.orig/linux-user/main.c	2007-12-11 16:14:01.000000000 -0700
+++ qemu/linux-user/main.c	2007-12-11 16:54:32.000000000 -0700
@@ -1890,6 +1890,43 @@
 }
 #endif /* TARGET_ALPHA */
 
+static const char *get_cpu_model_default()
+{
+    const char *cpu_model = "any";
+
+#if defined(TARGET_I386)
+#ifdef TARGET_X86_64
+    cpu_model = "qemu64";
+#else
+    cpu_model = "qemu32";
+#endif
+#elif defined(TARGET_ARM)
+    cpu_model = "arm926";
+#elif defined(TARGET_M68K)
+    cpu_model = "any";
+#elif defined(TARGET_SPARC)
+#ifdef TARGET_SPARC64
+    cpu_model = "TI UltraSparc II";
+#else
+    cpu_model = "Fujitsu MB86904";
+#endif
+#elif defined(TARGET_MIPS)
+#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64)
+    cpu_model = "20Kc";
+#else
+    cpu_model = "24Kf";
+#endif
+#elif defined(TARGET_PPC)
+#ifdef TARGET_PPC64
+    cpu_model = "970";
+#else
+    cpu_model = "750";
+#endif
+#endif
+
+    return cpu_model;
+}
+
 void usage(void)
 {
     printf("qemu-" TARGET_ARCH " version " QEMU_VERSION ", Copyright (c) 2003-2007 Fabrice Bellard\n"
@@ -1900,7 +1937,7 @@
            "-g port           wait gdb connection to port\n"
            "-L path           set the elf interpreter prefix (default=%s)\n"
            "-s size           set the stack size in bytes (default=%ld)\n"
-           "-cpu model        select CPU (-cpu ? for list)\n"
+           "-cpu model        select CPU (default=\"%s\"; -cpu ? for list)\n"
            "-drop-ld-preload  drop LD_PRELOAD for target process\n"
            "\n"
            "debug options:\n"
@@ -1910,6 +1947,7 @@
            TARGET_ARCH,
            interp_prefix,
            x86_stack_size,
+           get_cpu_model_default(),
            DEBUG_LOGFILE);
     _exit(1);
 }
@@ -2023,38 +2061,9 @@
     init_paths(interp_prefix);
 
     if (cpu_model == NULL) {
-#if defined(TARGET_I386)
-#ifdef TARGET_X86_64
-        cpu_model = "qemu64";
-#else
-        cpu_model = "qemu32";
-#endif
-#elif defined(TARGET_ARM)
-        cpu_model = "arm926";
-#elif defined(TARGET_M68K)
-        cpu_model = "any";
-#elif defined(TARGET_SPARC)
-#ifdef TARGET_SPARC64
-        cpu_model = "TI UltraSparc II";
-#else
-        cpu_model = "Fujitsu MB86904";
-#endif
-#elif defined(TARGET_MIPS)
-#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64)
-        cpu_model = "20Kc";
-#else
-        cpu_model = "24Kf";
-#endif
-#elif defined(TARGET_PPC)
-#ifdef TARGET_PPC64
-        cpu_model = "970";
-#else
-        cpu_model = "750";
-#endif
-#else
-        cpu_model = "any";
-#endif
+        cpu_model = get_cpu_model_default();
     }
+
     /* NOTE: we need to init the CPU at this stage to get
        qemu_host_page_size */
     env = cpu_init(cpu_model);

Reply via email to