From patchwork Sun Apr 17 18:30:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 562905 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp1891519map; Sun, 17 Apr 2022 12:15:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz39vkGsNBVM8PuAgJIyTISdoHTT63QBCu+yhB+dDjdp6rNWH4wkwoYgSvCVVTmY1MJ3WP X-Received: by 2002:a05:6214:5194:b0:446:3814:835f with SMTP id kl20-20020a056214519400b004463814835fmr5765347qvb.6.1650222957328; Sun, 17 Apr 2022 12:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650222957; cv=none; d=google.com; s=arc-20160816; b=ZEtUPorslpNhV+h2UwSPaGvQmc5t6vV5iz4w4ux1u607GWVkQnJdDXj/JvNLJdRt0u Vc37zlPAcMic2W3+D8qBtRDou5rCaB8RxGvKpXc5NyYp9evRuG6AH++hH8p09ZF394mD oNW4dpqc4gFdsjtBLLTi/YbfaTHjIv6p6lRyQtI9A4/HacqZKmxCeApYvUYXDODY8nuo wcYmtSzF9bUwFzWtBjs7gMe4wrBIerX6O6aX4k0MJTxwvxDO3idHtRbk7fBGu8pGeip/ TIhsaG4N2+4IILFxgDEf75MBAaf1zqDxtnGBXHe7SPZFlGrzblWQvi/Hz1AzSE6j0gz6 f5ZQ== 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=8g8xUltHBVQUHV98Q/wu8AvtaiRfGRVKXLPd8aD+jcM=; b=FrdN/olA9TJga2EZqqU67exc910bMccSrMBvRhJBuSSne5XVLRopZvZgT5G8Qyl5+z EgmBOWEU+4UNAHREhReO3HQ9sdz050Qt6x7j/mj19AwIhPgUxXVurTAWPN6yj6DeXJsN qeNjRzu/k79hWL5odJua+LWSs4IL3gDYCZdOBVoXrf4cySti/yeSRm4KJHDGXC6bB4Vi pvGkAnYSyLq9eQu9W5IQDxp0C0gsEiw7BNhTzFs3wnjUYyCghxShZdpzhY35z8tT/gNJ V4TccUnSV3N8SYDx4f+k3G8bF8e/PQ8TW13yds4UXKoGp2WJJADRlkrJaSFLbQUrreit Y1SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ihyVe4PP; 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 t1-20020a05621421a100b004444b688d5dsi2392901qvc.173.2022.04.17.12.15.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Apr 2022 12:15: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=ihyVe4PP; 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]:58882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngANI-00055h-T8 for patch@linaro.org; Sun, 17 Apr 2022 15:15:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ng9fo-0000XO-4n for qemu-devel@nongnu.org; Sun, 17 Apr 2022 14:31:00 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:35759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ng9fl-0001qr-87 for qemu-devel@nongnu.org; Sun, 17 Apr 2022 14:30:59 -0400 Received: by mail-pg1-x52f.google.com with SMTP id k62so9002601pgd.2 for ; Sun, 17 Apr 2022 11:30:49 -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=8g8xUltHBVQUHV98Q/wu8AvtaiRfGRVKXLPd8aD+jcM=; b=ihyVe4PP/zrSSRSjQVdvBHE8vf/Jw6bMHL6TgU+Z8aSMaUoO3TCyZkaCWHN9K7ME1P nS6N0eNSFfuZbi8jGv49y20heY3is0oESEv7ujw9Nhr2FIJmVOFV0usWHu4tac2pA5Fz kX7yfzzcT26uDKMYDtXJBWWnIYOhQ8PuKZmRWbeCe7EF1lyu0kqg5TkMgisEUgD/81dC HUTYF62Yk/E4yIut5VZzLUH6NYZoDwHcYc5a+eoN1RvBL1UPGJwm2dzsvW+DmV1wNoB4 Dzfjmdm6h/E55gc02GSCHTxt8GCPmYxYEgCVXg0CwWqFC09ocGu0DmOc2CE/Aj/LCtMl RDSw== 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=8g8xUltHBVQUHV98Q/wu8AvtaiRfGRVKXLPd8aD+jcM=; b=E4+JzaPIgiuyk5pUc7IHpxK4wkZuvZczQwsLa6FuiuYF5TUp2IgX9iNnaNZXoMn8Qz Ms+XEnxi8EM5xRUFA4B/t6Hz3ehxB0tfWNxP4x9BzYb/P8Eh4upXyh4igfuXSfwqhJX+ KQElM/khf3djWvVpgEY986KFBWwSEHXoJly7W/HAu8vmtDf71/b7KwtABg0j7tjsB2oB Zaa4DCCDtuiSA4XvAPmYyVC9UJbj3FA2b674kQXfpaOzdJpHk0s0MU09pykkEdEE3rKU +Xv9HBmUGjUTYr0J96cFbD+oiKQi62f5d6gIXKpx7tSV/svBppkxHV3ijVLFYtAUXBPf cK5A== X-Gm-Message-State: AOAM5310DVcWATmxNJVZijrqGiyD7MbyLeOJ6Zs3JjKOcWIyppDPhe2Q Q+5JazuM2kbmP7uPXJpcVy65STUPfOJT9g== X-Received: by 2002:a63:4c52:0:b0:398:db25:d2b8 with SMTP id m18-20020a634c52000000b00398db25d2b8mr7470619pgl.432.1650220248965; Sun, 17 Apr 2022 11:30:48 -0700 (PDT) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id on10-20020a17090b1d0a00b001d08a7d569csm8154011pjb.56.2022.04.17.11.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Apr 2022 11:30:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 34/39] util/log: Rename qemu_logfile_mutex to global_mutex Date: Sun, 17 Apr 2022 11:30:14 -0700 Message-Id: <20220417183019.755276-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220417183019.755276-1-richard.henderson@linaro.org> References: <20220417183019.755276-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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. Reviewed-by: Alex Bennée 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 425f0064b0..bb201664ac 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; @@ -101,9 +103,9 @@ void qemu_log(const char *fmt, ...) } } -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) @@ -123,7 +125,7 @@ static bool 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) {