From nobody Thu Nov 6 10:24:26 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 1540213079964490.26270475868273; Mon, 22 Oct 2018 05:57:59 -0700 (PDT) Received: from localhost ([::1]:34880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEZmQ-0007Ys-NA for importer@patchew.org; Mon, 22 Oct 2018 08:57:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEZPq-0002RD-Hi for qemu-devel@nongnu.org; Mon, 22 Oct 2018 08:34:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEZPn-0003Em-F4 for qemu-devel@nongnu.org; Mon, 22 Oct 2018 08:34:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58888) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gEZPm-0002vm-Qo for qemu-devel@nongnu.org; Mon, 22 Oct 2018 08:34:35 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 092BB8830B for ; Mon, 22 Oct 2018 12:34:20 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-34.ams2.redhat.com [10.36.117.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CD40104C529; Mon, 22 Oct 2018 12:34:17 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 004DD1132BA7; Mon, 22 Oct 2018 14:34:13 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 22 Oct 2018 14:33:40 +0200 Message-Id: <20181022123413.28044-8-armbru@redhat.com> In-Reply-To: <20181022123413.28044-1-armbru@redhat.com> References: <20181022123413.28044-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 22 Oct 2018 12:34:20 +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] [PULL 07/40] 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 Message-Id: <20181017082702.5581-6-armbru@redhat.com> --- 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 4404c28360..0c3d245932 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -252,7 +252,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 */ @@ -317,7 +317,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; @@ -1557,7 +1557,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 @@ -2590,9 +2590,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 @@ -2717,7 +2717,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 64c1af653d..baf236ae79 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -679,8 +679,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 e46a28910a..1d7630345b 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -32,7 +32,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.2