From nobody Tue Nov 26 18:43:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1705670741; cv=none; d=zohomail.com; s=zohoarc; b=PTQCl84swRWeaxlZp+5C8jjm1or+nGKO3D6O4pbQAFiEMLWYdYIuVEBbsyTH7XhLH479tVhnCdH2ubI41EyfoWB9ZV0CmKrewC7dqLlQKNfgIYTWVM6PIQs3zC74ZxBi4eQrOFX432hBYzpKh4IsuyocKJZJqSd36gC6OeP2/fM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705670741; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YfuQXxmvX9JAP4TN/xfu2dZ/IwBEFTowVO1pKbfDK8M=; b=PLgYeIqxMksgkpaaBjo3alwSsGgSKdN14qD5w70Q9eOWOld9ZM0zrXFqc0OXojkEeu5klDIbzD4cEdQMCL1tq3veaQfjeIiwfcD//to2Q9+bN2K6S3gkibtT+raK8mGIb6FTO0D8TpTB/LWENVGMZokmzEACaLI4fGchg/AM+RI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1705670741388924.3843780962228; Fri, 19 Jan 2024 05:25:41 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.669037.1041619 (Exim 4.92) (envelope-from ) id 1rQorn-0005k2-0I; Fri, 19 Jan 2024 13:25:03 +0000 Received: by outflank-mailman (output) from mailman id 669037.1041619; Fri, 19 Jan 2024 13:25:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rQorm-0005jv-T3; Fri, 19 Jan 2024 13:25:02 +0000 Received: by outflank-mailman (input) for mailman id 669037; Fri, 19 Jan 2024 13:25:01 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rQork-0005H3-W0 for xen-devel@lists.xenproject.org; Fri, 19 Jan 2024 13:25:00 +0000 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [2a00:1450:4864:20::530]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 24bdcc89-b6ce-11ee-9b0f-b553b5be7939; Fri, 19 Jan 2024 14:24:59 +0100 (CET) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-55a43f9a6c1so759207a12.1 for ; Fri, 19 Jan 2024 05:24:59 -0800 (PST) Received: from localhost.localdomain (adsl-138.37.6.1.tellas.gr. [37.6.1.138]) by smtp.gmail.com with ESMTPSA id b11-20020aa7dc0b000000b00558fc426affsm8568310edu.88.2024.01.19.05.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 05:24:58 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 24bdcc89-b6ce-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705670699; x=1706275499; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YfuQXxmvX9JAP4TN/xfu2dZ/IwBEFTowVO1pKbfDK8M=; b=AudWNYIX0EFJ4nKLpl/fYnsBq54ikKaLIxlSjWPmwsVENckm7gjMJ7dH61FnH+oLSc FY5BUaxeFfjog+UKg2X8pt1UBFPStmBEI4zHJZ/86GQUqo2Rq3c6vmWufca3T0NNhooD lUuaHIs5KnBXZOoy+zJ01tGLpCNLHbeQ6I4aYjlJOQ/ec9A1UoouK07UEgZFzmlOYreU 9fX3CqtreFzu9kAB0piwK8dn6ySGl4leT9tJcDOlJf76V/nt0cRWYEVL1yBaeQw/2MCX HZiy0DcYf5Vc3at46wU7xbHrCEo0r777ngXVrLKboeM+nVziGOOVvgGfkIvFZizrN9gl zl7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705670699; x=1706275499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YfuQXxmvX9JAP4TN/xfu2dZ/IwBEFTowVO1pKbfDK8M=; b=TKjM0QCX+CmxGVnf8i/qjW0smo5dupacDCDAR9VY4aoOAhMkt2qJu2F73PKWLEjIiA rRmi74ESXuUqFAG6z+4M+PO1T/2esoAqNlI7YGAyyfTZAKC94pZmra6hdqaqN/bnBvXY zQcQQaeIZB+4Zq3JRpnHW0Kg2WMTeUuGPToYA2/NIbcOfdHz3VzHzZYN/z7vgbxyL5rY JcuEq3JJhQI33u8yavPpei6zNu8t+DdQ276AT8maSFUjGEQhWPE+plUZS2fRdTTQ18H+ zxl0DJpaWXWN6/a6k5RswmWmdsmCv3B0aL9lW/ZFKffmn4RBQBIMKAB3sCv/B+qpazUn Nrnw== X-Gm-Message-State: AOJu0YwZ+zI6lq05RrN2qDohQfSi/6/jkETeO0uDRX1QmS44X432qwhd 2tW1hWAyKAStMTc/kZo6HGHSwdlVDg3+uMqJdQclkDml+XShtqdUP+/mjTDZoWHuo2lufCQUACv RDjc= X-Google-Smtp-Source: AGHT+IGSoNv5INVnSqko5OrH7zTf+jb7pBx9jX4flwfLWo+bpMWVQxBgd75egqiSm83wZgZZW9SGQA== X-Received: by 2002:a05:6402:c16:b0:55a:6086:7e1e with SMTP id co22-20020a0564020c1600b0055a60867e1emr457236edb.75.1705670698789; Fri, 19 Jan 2024 05:24:58 -0800 (PST) From: Manos Pitsidianakis To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Stefano Stabellini , Anthony Perard , Paul Durrant , xen-devel@lists.xenproject.org Subject: [PATCH v2 5/5] hw/xen: convert stderr prints to error/warn reports Date: Fri, 19 Jan 2024 15:24:47 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1705670742169100001 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Manos Pitsidianakis Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 05a29c6f11..baa1adb9f2 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 336c212376..4f956d048e 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 =CE=B3=CE=B1=E1=BF=96=CE=B1 =CF=80=CF=85=CF=81=CE=AF =CE=BC=CE=B9=CF=87=CE= =B8=CE=AE=CF=84=CF=89