[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 15/25] VFIO: Fix error_append_hint usage
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v3 15/25] VFIO: Fix error_append_hint usage |
Date: |
Tue, 24 Sep 2019 23:08:52 +0300 |
If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro.
Otherwise hint will not be appended in case of errp == &fatal_err
(program will exit before error_append_hint() call). Fix such cases.
This commit (together with its neighbors) was generated by
git grep -l 'error_append_hint(errp' | while read f; do \
spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \
--in-place $f; done
and then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"
(auto-msg was a file with this commit message)
Still, for backporting it may be more comfortable to use only the first
command and then do one huge commit.
Reported-by: Greg Kurz <address@hidden>
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
hw/vfio/common.c | 2 ++
hw/vfio/pci.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 3e03c495d8..d08276b1e6 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -1437,6 +1437,7 @@ static void vfio_disconnect_container(VFIOGroup *group)
VFIOGroup *vfio_get_group(int groupid, AddressSpace *as, Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
VFIOGroup *group;
char path[32];
struct vfio_group_status status = { .argsz = sizeof(status) };
@@ -1526,6 +1527,7 @@ void vfio_put_group(VFIOGroup *group)
int vfio_get_device(VFIOGroup *group, const char *name,
VFIODevice *vbasedev, Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
struct vfio_device_info dev_info = { .argsz = sizeof(dev_info) };
int ret, fd;
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index c5e6fe61cb..57208c7075 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2469,6 +2469,7 @@ int vfio_populate_vga(VFIOPCIDevice *vdev, Error **errp)
static void vfio_populate_device(VFIOPCIDevice *vdev, Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
VFIODevice *vbasedev = &vdev->vbasedev;
struct vfio_region_info *reg_info;
struct vfio_irq_info irq_info = { .argsz = sizeof(irq_info) };
@@ -2700,6 +2701,7 @@ static void vfio_unregister_req_notifier(VFIOPCIDevice
*vdev)
static void vfio_realize(PCIDevice *pdev, Error **errp)
{
+ ERRP_FUNCTION_BEGIN();
VFIOPCIDevice *vdev = PCI_VFIO(pdev);
VFIODevice *vbasedev_iter;
VFIOGroup *group;
--
2.21.0
- [PATCH v3 08/25] ARM TCG CPUs: Fix error_append_hint usage, (continued)
- [PATCH v3 08/25] ARM TCG CPUs: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 06/25] python: add commit-per-subsystem.py, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 09/25] PowerPC TCG CPUs: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 10/25] arm: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 04/25] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 11/25] SmartFusion2: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 13/25] SCSI: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 12/25] PCI: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 14/25] USB: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 15/25] VFIO: Fix error_append_hint usage,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v3 16/25] virtio: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 22/25] Migration: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 18/25] block: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 17/25] virtio-9p: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 21/25] QOM: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 20/25] cmdline: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 19/25] chardev: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 25/25] PVRDMA: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24
- [PATCH v3 24/25] nbd: Fix error_append_hint usage, Vladimir Sementsov-Ogievskiy, 2019/09/24