From patchwork Mon Feb 11 16:41:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 14738 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0810723ECC for ; Mon, 11 Feb 2013 16:41:36 +0000 (UTC) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by fiordland.canonical.com (Postfix) with ESMTP id 901D5A18BEC for ; Mon, 11 Feb 2013 16:41:35 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id fk10so1861387vcb.21 for ; Mon, 11 Feb 2013 08:41:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=YIdvQGWRAi0TUFCHCWjnVNPQiksbAGGH2YlLRlIbZk4=; b=UsFL4hKTDz9HOn4D6u9zN/6C4ljRqsF/5bS1fuLdR7siWjE+f1xh8NymVIIFLdQry6 WX270DZrrtEWAiG3RQDYWH1FcpbZBlLWHldX13ptiymcJn39S5upzaPSHPJfx1zrYtm4 SKOs9zdFQyDzLyLM21BvGAPmGd1IMArUiXdki7MYIajeDoCeFAQArkfVRhwL1+ELKC7w ZrAW2Ym1UHr0/BfyPLuP7ImHcVOxl+xxkKlTfuzxGjRl1rrqQzU602f0kvSRyRO6EGpq VY5U1kbffEG/WBogh0a9ukirU/hBwmXLotH8hTcP97AsdC3/9yQuFC4y7aSmu6m34poi W07g== X-Received: by 10.58.232.226 with SMTP id tr2mr19422387vec.48.1360600894978; Mon, 11 Feb 2013 08:41:34 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.252.8 with SMTP id zo8csp106482vec; Mon, 11 Feb 2013 08:41:34 -0800 (PST) X-Received: by 10.180.85.103 with SMTP id g7mr17499056wiz.29.1360600890258; Mon, 11 Feb 2013 08:41:30 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id fk9si6455240wib.125.2013.02.11.08.41.29 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 Feb 2013 08:41:30 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1U4wRa-0001oA-3V; Mon, 11 Feb 2013 16:41:26 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Blue Swirl , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Hajnoczi Subject: [PATCH 5/6] cpus.c: Drop unnecessary set_cpu_log() Date: Mon, 11 Feb 2013 16:41:24 +0000 Message-Id: <1360600885-6917-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1360600885-6917-1-git-send-email-peter.maydell@linaro.org> References: <1360600885-6917-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQmjpee4PQCqhjsv1LIGNuJ/rXXUgYzF4JmdLrvoQxmpRnKDVY0Ljdx1IZu6R94YDa/6ht4d 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 Reviewed-by: Andreas Färber --- cpus.c | 12 ------------ include/sysemu/cpus.h | 1 - vl.c | 9 ++++++++- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/cpus.c b/cpus.c index 24e6aff..c4b021d 100644 --- 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 */ diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h index 60e44bb..6502488 100644 --- a/include/sysemu/cpus.h +++ b/include/sysemu/cpus.h @@ -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 06e5369..2e204d0 100644 --- a/vl.c +++ b/vl.c @@ -3860,10 +3860,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)) {