From nobody Thu Nov 6 06:15:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539605133451508.5226534835741; Mon, 15 Oct 2018 05:05:33 -0700 (PDT) Received: from localhost ([::1]:51871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gC1cq-0004X9-AI for importer@patchew.org; Mon, 15 Oct 2018 08:05:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gC1RB-0004GQ-HO for qemu-devel@nongnu.org; Mon, 15 Oct 2018 07:53:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gC1R5-00026a-6o for qemu-devel@nongnu.org; Mon, 15 Oct 2018 07:53:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35894) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gC1R3-0001yR-8c for qemu-devel@nongnu.org; Mon, 15 Oct 2018 07:53:21 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D9E930B8449 for ; Mon, 15 Oct 2018 11:53:16 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4E8C5D78E; Mon, 15 Oct 2018 11:53:12 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B4CFA1132D9B; Mon, 15 Oct 2018 13:53:09 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 15 Oct 2018 13:52:39 +0200 Message-Id: <20181015115309.17089-6-armbru@redhat.com> In-Reply-To: <20181015115309.17089-1-armbru@redhat.com> References: <20181015115309.17089-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 15 Oct 2018 11:53:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 05/35] vfio: Use warn_report() & friends to report warnings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The vfio code reports warnings like error_report(WARN_PREFIX "Could not frobnicate", DEV-NAME); where WARN_PREFIX is defined so the message comes out as vfio warning: DEV-NAME: Could not frobnicate This usage predates the introduction of warn_report() & friends in commit 97f40301f1d. It's time to convert to that interface. Since these functions already prefix the message with "warning: ", replace WARN_PREFIX by VFIO_MSG_PREFIX, so the messages come out like warning: vfio DEV-NAME: Could not frobnicate The next commit will replace ERR_PREFIX. Cc: Alex Williamson Signed-off-by: Markus Armbruster Acked-by: Alex Williamson Reviewed-by: Eric Blake --- hw/vfio/pci.c | 14 +++++++------- hw/vfio/platform.c | 4 ++-- include/hw/vfio/vfio-common.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8c95fc648a..79ea45e1f3 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -249,7 +249,7 @@ static void vfio_intx_update(PCIDevice *pdev) =20 vfio_intx_enable_kvm(vdev, &err); if (err) { - error_reportf_err(err, WARN_PREFIX, vdev->vbasedev.name); + warn_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name); } =20 /* Re-enable the interrupt in cased we missed an EOI */ @@ -314,7 +314,7 @@ static int vfio_intx_enable(VFIOPCIDevice *vdev, Error = **errp) =20 vfio_intx_enable_kvm(vdev, &err); if (err) { - error_reportf_err(err, WARN_PREFIX, vdev->vbasedev.name); + warn_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name); } =20 vdev->interrupt =3D VFIO_INT_INTx; @@ -1554,7 +1554,7 @@ static int vfio_msix_setup(VFIOPCIDevice *vdev, int p= os, Error **errp) &err); if (ret < 0) { if (ret =3D=3D -ENOTSUP) { - error_report_err(err); + warn_report_err(err); return 0; } =20 @@ -2587,9 +2587,9 @@ static void vfio_populate_device(VFIOPCIDevice *vdev,= Error **errp) } else if (irq_info.count =3D=3D 1) { vdev->pci_aer =3D true; } else { - error_report(WARN_PREFIX - "Could not enable error recovery for the device", - vbasedev->name); + warn_report(VFIO_MSG_PREFIX + "Could not enable error recovery for the device", + vbasedev->name); } } =20 @@ -2714,7 +2714,7 @@ static void vfio_req_notifier_handler(void *opaque) =20 qdev_unplug(&vdev->pdev.qdev, &err); if (err) { - error_reportf_err(err, WARN_PREFIX, vdev->vbasedev.name); + warn_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name); } } =20 diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 57c4a0ee2b..c1aecac43c 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -657,8 +657,8 @@ static void vfio_platform_realize(DeviceState *dev, Err= or **errp) =20 for (i =3D 0; i < vbasedev->num_regions; i++) { if (vfio_region_mmap(vdev->regions[i])) { - error_report("%s mmap unsupported. Performance may be slow", - memory_region_name(vdev->regions[i]->mem)); + warn_report("%s mmap unsupported, performance may be slow", + memory_region_name(vdev->regions[i]->mem)); } sysbus_init_mmio(sbdev, vdev->regions[i]->mem); } diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 6be9a93f61..c788e68bf8 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -31,7 +31,7 @@ #endif =20 #define ERR_PREFIX "vfio error: %s: " -#define WARN_PREFIX "vfio warning: %s: " +#define VFIO_MSG_PREFIX "vfio %s: " =20 enum { VFIO_DEVICE_TYPE_PCI =3D 0, --=20 2.17.1