From patchwork Sun Mar 20 17:11:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 553204 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp887545mag; Sun, 20 Mar 2022 10:41:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk/Ige98G9yhYhn4MICgYP8F8mXLI7UMPOsIurnu3+CdZMTl6RGjmnJybGP2Cx/pf/Ywh1 X-Received: by 2002:a05:620a:a57:b0:67d:396a:8a9d with SMTP id j23-20020a05620a0a5700b0067d396a8a9dmr11039690qka.322.1647798117757; Sun, 20 Mar 2022 10:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647798117; cv=none; d=google.com; s=arc-20160816; b=Ttf/8rVtOiP1skrSqunRu29EkC2vvLzUBBxkVJx3RnyUqyHeNNRJ6QbtuQCr5DPHAc +jS9ZebpPeNwn/cnoRozgfJpoWn2RZaNtMLGh7zvi5yE45XdbDrKUhZyA7xag5nmtNBL dUp50mL0soh9UhsAMGFeUJsCbgFNJD0g+p7v8t1Qcd7hqyRAqRs/KcCyJxoElfuHhQdw FqmeCuEVYgfrgifPiJgwRbEf90G75Fa66l5NbIRKQ6VyBgsbdiux+v7p15JenG9MIIFX GrO90Sb6IP8Gvk+5TqMYm9YuGy8lglKqBzqKA5UjvPG7WUSFHiVYGQy758VxTooEYi1x rroQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=djzZiLuHHr1dL1YPwKuuIKcK6Xvam7Lxv67yyC1ECSo=; b=fnh7r8W/XlKDWkB7b6IeDlLSok8froIWlP0Ga95y9MCUxr5qn95uMFJD4md25Z6G0r UkU3oC+awYjxfv5iNWGXqyiybBN+mYkA00hcKS8l4myFVp32pgWqYP1UgMjHCBJjoE/p RfJss85wTPvWKv51ZiAfCdVR5bIoDHtHI1ScUU+9sPtaD0BEDeRHXhHjkgrYQjBNq+0E GarvT/RUoXih1zhUrzIYn063uMrGrydmRbQUFzyE1BzzwYlJt+eAMY+bdAvjO4tH8SrE uokbTOXJzkj9Cm/hMlmtr6UhblBEWdDtWARBekWJKQXlz8+0QkzNfEgvFccIjt95zH75 /Mkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wy13zcjz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j6-20020a0cfd46000000b00440e46a7cb0si1263432qvs.334.2022.03.20.10.41.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Mar 2022 10:41:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wy13zcjz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVzYy-0006FW-19 for patch@linaro.org; Sun, 20 Mar 2022 13:41:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVz67-0000QM-TH for qemu-devel@nongnu.org; Sun, 20 Mar 2022 13:12:07 -0400 Received: from [2607:f8b0:4864:20::62d] (port=42804 helo=mail-pl1-x62d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVz66-0003W6-DK for qemu-devel@nongnu.org; Sun, 20 Mar 2022 13:12:07 -0400 Received: by mail-pl1-x62d.google.com with SMTP id p17so10876873plo.9 for ; Sun, 20 Mar 2022 10:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=djzZiLuHHr1dL1YPwKuuIKcK6Xvam7Lxv67yyC1ECSo=; b=Wy13zcjzhRw/UmQnsSco9nDFFjzFjYfWT1KH3Gh6A4G8t/b57AIgVHIj3iXoxzJEou 0E4OVjOV5P1NFKaqsYg7tNzHymvGfw4R6VIRS9tUUGjf/sSPnc9zObzqrDEkan8UgLGw Du5xr7uzYBQdIBxaUDvBOkx19rsDs+ZRUH/8FVM7gvKhrjjldxzsZ0eirS44birEfSBm 1ssgYAzLT6yHOFf7kJfFlAc893zehOiazsLdmOT5X3JFtKeJoCLNwHITQzJqjGLbgYqq 2xhXmVjOafJBuD10h4rqy+eoyx7gPnF4LdqjceEkSVNMQA3k5KpGIzk9tBhNQg+yDPVN 1YvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=djzZiLuHHr1dL1YPwKuuIKcK6Xvam7Lxv67yyC1ECSo=; b=rgZwjVF+Uuoy4kPQQjil6ZytMro615g90IJpXbs+KEUfKoDWkv/7RiuYgMr+oZxw0G Za9rtcTHWqZC08GRN/cfDs7iNrAeusE2H2BVIYbG9/mxm0mJhd59k/e3W86M6VWMv85+ 5NKghzLoDJgsPZEsvZTWOqXkzK9PxOVSqCY56Y2YsT8BymfeuFN2MbPRhDoVQZsNszuV a2rLalMp1+dHn6igoiEdpicUmXh1r/7/gjneaWsuqoqYmM1A/YpjqQw1MsLk+YwXFvRS BVY8gMroCquND8QgPsGcyS48CNAUY8fxq3jxujcrPAMU7yNG41jA6KVcasgHoap+fnUk pAsw== X-Gm-Message-State: AOAM532VaDBXCoRnZberXA2Jn6x8IrQ+Y1pjtB3jkJNaa4N15k78jghO bkOMlGdqrJ/oYUlDQ+9WJSoLCZ2WmFD5fQ== X-Received: by 2002:a17:902:c949:b0:154:5215:1db1 with SMTP id i9-20020a170902c94900b0015452151db1mr2223793pla.163.1647796325188; Sun, 20 Mar 2022 10:12:05 -0700 (PDT) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id q12-20020a17090aa00c00b001bc6f1baaaesm17149697pjp.39.2022.03.20.10.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 10:12:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-7.1 31/36] util/log: Rename qemu_logfile_mutex to global_mutex Date: Sun, 20 Mar 2022 10:11:30 -0700 Message-Id: <20220320171135.2704502-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320171135.2704502-1-richard.henderson@linaro.org> References: <20220320171135.2704502-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Rename to emphasize this covers the file-scope global variables. Signed-off-by: Richard Henderson --- util/log.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/util/log.c b/util/log.c index 0676ce5bd6..42b13e6bf1 100644 --- a/util/log.c +++ b/util/log.c @@ -34,9 +34,11 @@ typedef struct QemuLogFile { FILE *fd; } QemuLogFile; +/* Mutex covering the other global_* variables. */ +static QemuMutex global_mutex; static char *global_filename; -static QemuMutex qemu_logfile_mutex; static QemuLogFile *global_file; + int qemu_loglevel; static int log_append = 0; static GArray *debug_regions; @@ -110,9 +112,9 @@ int qemu_log(const char *fmt, ...) return ret; } -static void __attribute__((__constructor__)) qemu_logfile_init(void) +static void __attribute__((__constructor__)) startup(void) { - qemu_mutex_init(&qemu_logfile_mutex); + qemu_mutex_init(&global_mutex); } static void qemu_logfile_free(QemuLogFile *logfile) @@ -132,7 +134,7 @@ static void qemu_set_log_internal(const char *filename, bool changed_name, bool need_to_open_file; QemuLogFile *logfile; - QEMU_LOCK_GUARD(&qemu_logfile_mutex); + QEMU_LOCK_GUARD(&global_mutex); logfile = global_file; if (changed_name) {