]> git.proxmox.com Git - qemu.git/commitdiff
cpus.c: Drop unnecessary set_cpu_log()
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 11 Feb 2013 16:41:24 +0000 (16:41 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 16 Feb 2013 10:45:19 +0000 (10:45 +0000)
The set_cpu_log() function in cpus.c is a fairly simple wrapper
which is only called from one location. Just inline the code
into vl.c, since there is no need to indirect it via cpus.c
and the handling of the error case is more appropriate to vl.c.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cpus.c
include/sysemu/cpus.h
vl.c

diff --git a/cpus.c b/cpus.c
index 24e6affbf78d4801568e760025bb08bf25eddfcb..c4b021dd2eb04ad3eed7f986eabe195f672ec66d 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -1175,18 +1175,6 @@ void set_numa_modes(void)
     }
 }
 
-void set_cpu_log(const char *optarg)
-{
-    int mask;
-
-    mask = qemu_str_to_log_mask(optarg);
-    if (!mask) {
-        qemu_print_log_usage(stdout);
-        exit(1);
-    }
-    qemu_set_log(mask);
-}
-
 void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
 {
     /* XXX: implement xxx_cpu_list for targets that still miss it */
index 60e44bb70ca5a62657203f04b66236b3214d9e99..6502488a05b48161cccca525811ae2ff6b6eacd4 100644 (file)
@@ -24,7 +24,6 @@ extern int smp_threads;
 #endif
 
 void set_numa_modes(void);
-void set_cpu_log(const char *optarg);
 void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg);
 
 #endif
diff --git a/vl.c b/vl.c
index f9f4dda2d787ed7863567e31d81e2910f5af8c33..c5b0eea29b6a37bb95f0ebdd8197acb51bec2bac 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3864,10 +3864,17 @@ int main(int argc, char **argv, char **envp)
      * location or level of logging.
      */
     if (log_mask) {
+        int mask;
         if (log_file) {
             qemu_set_log_filename(log_file);
         }
-        set_cpu_log(log_mask);
+
+        mask = qemu_str_to_log_mask(log_mask);
+        if (!mask) {
+            qemu_print_log_usage(stdout);
+            exit(1);
+        }
+        qemu_set_log(mask);
     }
 
     if (!trace_backend_init(trace_events, trace_file)) {