From patchwork Mon Feb 11 16:41:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 14741 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 7ECFC23E33 for ; Mon, 11 Feb 2013 16:41:48 +0000 (UTC) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by fiordland.canonical.com (Postfix) with ESMTP id 30C5FA18BEC for ; Mon, 11 Feb 2013 16:41:48 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id pb11so5337000veb.33 for ; Mon, 11 Feb 2013 08:41:47 -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=H+AB0IuDh6MbEeBkhOEtfKc3xeuVyNe8X+zwj3jaeoA=; b=PIKjq/ISgZVJ8vfL3mUo9f+yNFdgpNLyEQ/iuWw736XwcG1SOpca4Ra8UWoMfmYJ49 DTbwbNTxXvjqBTDUASBNU6fck3WuUhSGBUxXOn1ZcMuaBKxwZUoFRwJQ5mTaYpStr7a3 O6Zk0rfgItgP4zKq7gHIXNrLMWXlvlCCrVthiI5Fj88XyXVzyx1L147pZPUqBMW+oOS+ pzgsKALqkyhdpMKSJDrMM5qDk+0V2ZG7U7/9eIFTK+kiNwxEHRlkHKXMakYX4T1wOpxu 0+1BV6p2Z19OMtMtZ2GJJQ6d1FPpgE4I30pjiMs3DpuAltTzDPoPsNfBdOxCfkdSuHn6 bpWA== X-Received: by 10.58.231.196 with SMTP id ti4mr19618817vec.25.1360600901091; Mon, 11 Feb 2013 08:41:41 -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 zo8csp106489vec; Mon, 11 Feb 2013 08:41:37 -0800 (PST) X-Received: by 10.43.7.7 with SMTP id om7mr17908754icb.25.1360600891921; Mon, 11 Feb 2013 08:41:31 -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 y1si50472451pav.16.2013.02.11.08.41.30 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 Feb 2013 08:41:31 -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-0001o8-2B; 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 4/6] qemu-log: Rename the public-facing cpu_set_log function to qemu_set_log Date: Mon, 11 Feb 2013 16:41:23 +0000 Message-Id: <1360600885-6917-5-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: ALoCoQnFuoGuikM3WMiEMukPtdI6/DW8irN4wfykPrA9bVr2g1c4+4LN0zIPevU+f9pSX1cCAvIq Rename the public-facing function cpu_set_log to qemu_set_log. This requires us to rename the internal-only qemu_set_log() to do_qemu_set_log(). Signed-off-by: Peter Maydell Reviewed-by: Andreas Färber --- bsd-user/main.c | 2 +- cpus.c | 2 +- hw/ppc.c | 2 +- include/qemu/log.h | 12 ++++++++---- linux-user/main.c | 2 +- monitor.c | 2 +- qemu-log.c | 4 ++-- target-i386/translate.c | 2 +- tcg/tci/tcg-target.c | 2 +- 9 files changed, 17 insertions(+), 13 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 4b12e65..097fbfe 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -870,7 +870,7 @@ int main(int argc, char **argv) qemu_print_log_usage(stdout); exit(1); } - cpu_set_log(mask); + qemu_set_log(mask); } if (optind >= argc) { diff --git a/cpus.c b/cpus.c index 63cfb73..24e6aff 100644 --- a/cpus.c +++ b/cpus.c @@ -1184,7 +1184,7 @@ void set_cpu_log(const char *optarg) qemu_print_log_usage(stdout); exit(1); } - cpu_set_log(mask); + qemu_set_log(mask); } void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg) diff --git a/hw/ppc.c b/hw/ppc.c index c52e22f..6053bd5 100644 --- a/hw/ppc.c +++ b/hw/ppc.c @@ -1189,7 +1189,7 @@ void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val) break; case 2: printf("Set loglevel to %04" PRIx32 "\n", val); - cpu_set_log(val | 0x100); + qemu_set_log(val | 0x100); break; } } diff --git a/include/qemu/log.h b/include/qemu/log.h index 10792ce..5dcbe11 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -143,14 +143,18 @@ typedef struct CPULogItem { extern const CPULogItem cpu_log_items[]; -void qemu_set_log(int log_flags, bool use_own_buffers); +/* This is the function that actually does the work of + * changing the log level; it should only be accessed via + * the qemu_set_log() wrapper. + */ +void do_qemu_set_log(int log_flags, bool use_own_buffers); -static inline void cpu_set_log(int log_flags) +static inline void qemu_set_log(int log_flags) { #ifdef CONFIG_USER_ONLY - qemu_set_log(log_flags, true); + do_qemu_set_log(log_flags, true); #else - qemu_set_log(log_flags, false); + do_qemu_set_log(log_flags, false); #endif } diff --git a/linux-user/main.c b/linux-user/main.c index 5257552..8a61ea4 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3104,7 +3104,7 @@ static void handle_arg_log(const char *arg) qemu_print_log_usage(stdout); exit(1); } - cpu_set_log(mask); + qemu_set_log(mask); } static void handle_arg_log_filename(const char *arg) diff --git a/monitor.c b/monitor.c index 2a55d56..6aac4c2 100644 --- a/monitor.c +++ b/monitor.c @@ -981,7 +981,7 @@ static void do_log(Monitor *mon, const QDict *qdict) return; } } - cpu_set_log(mask); + qemu_set_log(mask); } static void do_singlestep(Monitor *mon, const QDict *qdict) diff --git a/qemu-log.c b/qemu-log.c index 10a8581..a96db88 100644 --- a/qemu-log.c +++ b/qemu-log.c @@ -54,7 +54,7 @@ void qemu_log_mask(int mask, const char *fmt, ...) } /* enable or disable low levels log */ -void qemu_set_log(int log_flags, bool use_own_buffers) +void do_qemu_set_log(int log_flags, bool use_own_buffers) { const char *fname = logfilename ?: DEFAULT_LOGFILENAME; @@ -94,7 +94,7 @@ void qemu_set_log_filename(const char *filename) fclose(qemu_logfile); qemu_logfile = NULL; } - cpu_set_log(qemu_loglevel); + qemu_set_log(qemu_loglevel); } const CPULogItem cpu_log_items[] = { diff --git a/target-i386/translate.c b/target-i386/translate.c index 32d21f5..112c310 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -6854,7 +6854,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, #else /* start debug */ tb_flush(env); - cpu_set_log(CPU_LOG_INT | CPU_LOG_TB_IN_ASM); + qemu_set_log(CPU_LOG_INT | CPU_LOG_TB_IN_ASM); #endif break; #endif diff --git a/tcg/tci/tcg-target.c b/tcg/tci/tcg-target.c index 1707169..2d561b3 100644 --- a/tcg/tci/tcg-target.c +++ b/tcg/tci/tcg-target.c @@ -888,7 +888,7 @@ static void tcg_target_init(TCGContext *s) #if defined(CONFIG_DEBUG_TCG_INTERPRETER) const char *envval = getenv("DEBUG_TCG"); if (envval) { - cpu_set_log(strtol(envval, NULL, 0)); + qemu_set_log(strtol(envval, NULL, 0)); } #endif