From nobody Tue Nov 26 15:29:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706888436; cv=none; d=zohomail.com; s=zohoarc; b=GzPxr3fcmK9BVwRFWyzvgLispfvSfo/UI9vuiInGG5eAF8cSexng9LBcdBZI9rKXl335IYFcpAvdSOlEDg/JwtkxkZ9fCV9/FuBgNJuc4WArRw2iLstfAfRWQDrqh7N2ghg8FuJPB7katg0q5gl6V/b3D+cLPTUOmex9Ybfpv/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706888436; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=6766GInC0KCZwdcNkPeeQ9H7YYISDkqkH81Ih8qmKD4=; b=SbkFEnCkeJajsLcL+EnwDicf06Wxsy5oi1nA7CA9JzPz9Nw80npAZmWJAJ2h8tHttt7xjlbtyzomHdPW3PeDauH2RIQWpAAcmRQRop0R2Mfc/MQ2yFWAO0UTcPPe/ZZofYlgvmVt3/3k8A/2tObCYhDNaHSdEHOil2jOdIl+w4Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706888436301996.4962882999519; Fri, 2 Feb 2024 07:40:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rVvb7-0000Ob-5M; Fri, 02 Feb 2024 10:36:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rVvb5-0000NJ-1t for qemu-devel@nongnu.org; Fri, 02 Feb 2024 10:36:55 -0500 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rVvb3-0004XR-Ba for qemu-devel@nongnu.org; Fri, 02 Feb 2024 10:36:54 -0500 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-511234430a4so3722073e87.3 for ; Fri, 02 Feb 2024 07:36:52 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id k2-20020a05600c1c8200b0040fafd84095sm214735wms.41.2024.02.02.07.36.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 07:36:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706888211; x=1707493011; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6766GInC0KCZwdcNkPeeQ9H7YYISDkqkH81Ih8qmKD4=; b=Qi4o2/Be5kcx5BI0OpcpQ/+vdaV/2rm9WWyD4CCf7FI55zOI77BgIGQZTkkI2yTWm3 Wuap1eIdEB7JaawS18wDOU/o/qwuTL+j0MRh4kCAADhilj44ra2xoFsHD5U3CsRCUfR5 uNA+rBaWDeRb1VpfxB2wTXcDipL5SR8y0WCuZqFl/getChVygVleoCowpQEF0pHjBHCp Yach0ppR+IGitaM4RhHVPQ6Z4fyYsQvbTHMLAIQRwP6GXBxEDPl/uLMKghIi0kBb7Plm aWZLcPLMC680o8ZNQYQslz6iHw/L4o6uBvCKHoFBE/A7csOkX9C8TpDDYARVm8KCVgub v/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706888211; x=1707493011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6766GInC0KCZwdcNkPeeQ9H7YYISDkqkH81Ih8qmKD4=; b=Bopl5aFem0sPGlmx4LdPrnyciUlBGDfEht6TZ6NpqHxdp6dLFbuxeykX2C42d6rpqu BKDLm+T3AOA35KP7+HaEsF1wlT4tLzAt+a65iWVbsypZ+Z2Gf11gG16zLLgV7z2HwQ0a yyZzJj14dDIC5KxTTeFyB30uBsnBCRCJMU6sTT0u5TN3zAWDH9/T8qOuJFx031hgmYTy 7C1+5WZ66Ae7pTJw14CnDGiIu1z5mnGzC/9jk9f7W1N7dLE3uEzWJhebCD4x7iAFBiof aheO5+IRWJ9Fd6hjHc4FvEBTCsodDDb7wxmpI0wNV2tgO9OEElucWU9epfNnz2OcrsTT ihlw== X-Gm-Message-State: AOJu0YyleP/7EpA3WYzDlALJLok1bcNMNWcJglwQwXWv+mXVNvGebqMq i4c9kMOs+8Pw5NdM3ZaXYfeTzLHUl9dBPggHPIB3QN6Pk+GtgQ5wU/fzAdKqITZB4HcMVxGZEej V X-Google-Smtp-Source: AGHT+IHps3qmyOKFbxMqfyVvxJwnYfS8Z7zYNtB1W/G9B+8/paMGphTVf0/mOOfAoSG15FpzZQfrdQ== X-Received: by 2002:a19:7605:0:b0:50e:6168:c99d with SMTP id c5-20020a197605000000b0050e6168c99dmr3934626lff.27.1706888211636; Fri, 02 Feb 2024 07:36:51 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/36] hw/xen: convert stderr prints to error/warn reports Date: Fri, 2 Feb 2024 15:36:29 +0000 Message-Id: <20240202153637.3710444-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240202153637.3710444-1-peter.maydell@linaro.org> References: <20240202153637.3710444-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x135.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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706888436561100001 From: Manos Pitsidianakis According to the QEMU Coding Style document: > Do not use printf(), fprintf() or monitor_printf(). Instead, use > error_report() or error_vreport() from error-report.h. This ensures the > error is reported in the right place (current monitor or stderr), and in > a uniform format. > Use error_printf() & friends to print additional information. This commit changes fprintfs that report warnings and errors to the appropriate report functions. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Manos Pitsidianakis Reviewed-by: Alex Benn=C3=A9e Message-id: 42a8953553cf68e8bacada966f93af4fbce45919.1706544115.git.manos.p= itsidianakis@linaro.org Signed-off-by: Peter Maydell --- hw/xen/xen-hvm-common.c | 12 ++++++------ hw/xen/xen-mapcache.c | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 05a29c6f11a..baa1adb9f23 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -20,8 +20,8 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, = MemoryRegion *mr, =20 if (runstate_check(RUN_STATE_INMIGRATE)) { /* RAM already populated in Xen */ - fprintf(stderr, "%s: do not alloc "RAM_ADDR_FMT - " bytes of ram at "RAM_ADDR_FMT" when runstate is INMIGRAT= E\n", + warn_report("%s: do not alloc "RAM_ADDR_FMT + " bytes of ram at "RAM_ADDR_FMT" when runstate is INMIGRAT= E", __func__, size, ram_addr); return; } @@ -552,9 +552,9 @@ static void cpu_handle_ioreq(void *opaque) req->data =3D copy.data; =20 if (req->state !=3D STATE_IOREQ_INPROCESS) { - fprintf(stderr, "Badness in I/O request ... not in service?!: " + warn_report("Badness in I/O request ... not in service?!: " "%x, ptr: %x, port: %"PRIx64", " - "data: %"PRIx64", count: %u, size: %u, type: %u\n", + "data: %"PRIx64", count: %u, size: %u, type: %u", req->state, req->data_is_ptr, req->addr, req->data, req->count, req->size, req->type); destroy_hvm_domain(false); @@ -758,9 +758,9 @@ void xen_shutdown_fatal_error(const char *fmt, ...) va_list ap; =20 va_start(ap, fmt); - vfprintf(stderr, fmt, ap); + error_vreport(fmt, ap); va_end(ap); - fprintf(stderr, "Will destroy the domain.\n"); + error_report("Will destroy the domain."); /* destroy the domain */ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); } diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 336c2123767..4f956d048ee 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -347,9 +347,8 @@ tryagain: MapCacheRev *reventry =3D g_new0(MapCacheRev, 1); entry->lock++; if (entry->lock =3D=3D 0) { - fprintf(stderr, - "mapcache entry lock overflow: "HWADDR_FMT_plx" -> %p\= n", - entry->paddr_index, entry->vaddr_base); + error_report("mapcache entry lock overflow: "HWADDR_FMT_plx" -= > %p", + entry->paddr_index, entry->vaddr_base); abort(); } reventry->dma =3D dma; --=20 2.34.1