]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
Fix cpu list("-cpu ?") breakage, spotted by TeLeMan
authorBlue Swirl <blauwirbel@gmail.com>
Tue, 4 May 2010 19:55:35 +0000 (19:55 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Tue, 4 May 2010 19:55:35 +0000 (19:55 +0000)
Fix breakage by 04c9a0cbc2bf496889cef6da2d61bf00ef190a4f.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cpus.c
cpus.h
vl.c

diff --git a/cpus.c b/cpus.c
index 2bf87d2d5ea3e91366ba71fe2bc7f6c7c4580f0d..29462e5c924caa69ff93f1c19b1c2a381e95a50e 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -801,3 +801,14 @@ int64_t cpu_get_icount(void)
     }
     return qemu_icount_bias + (icount << icount_time_shift);
 }
+
+void list_cpus(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
+               const char *optarg)
+{
+    /* XXX: implement xxx_cpu_list for targets that still miss it */
+#if defined(cpu_list_id)
+    cpu_list_id(f, cpu_fprintf, optarg);
+#elif defined(cpu_list)
+    cpu_list(f, cpu_fprintf); /* deprecated */
+#endif
+}
diff --git a/cpus.h b/cpus.h
index 4ebad3a36f312c4b148792c64b8bc57aef48dccf..774150a763a53cbc28dcab51cd52f5b98804a505 100644 (file)
--- a/cpus.h
+++ b/cpus.h
@@ -16,5 +16,7 @@ void vm_state_notify(int running, int reason);
 bool tcg_cpu_exec(void);
 void set_numa_modes(void);
 void set_cpu_log(const char *optarg);
+void list_cpus(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
+               const char *optarg);
 
 #endif
diff --git a/vl.c b/vl.c
index 999aac8cc549e6a4252e389a93f556fd2cfba5c7..85bcc84df29f044c84b4a3e77e7a576567a96735 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -2726,12 +2726,7 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_cpu:
                 /* hw initialization will check this */
                 if (*optarg == '?') {
-/* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list_id)
-                    cpu_list_id(stdout, &fprintf, optarg);
-#elif defined(cpu_list)
-                    cpu_list(stdout, &fprintf);                /* deprecated */
-#endif
+                    list_cpus(stdout, &fprintf, optarg);
                     exit(0);
                 } else {
                     cpu_model = optarg;