[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 22/26] vfio: Reverse test on vfio_get_dirty_bitmap()
From: |
Cédric Le Goater |
Subject: |
[PATCH v3 22/26] vfio: Reverse test on vfio_get_dirty_bitmap() |
Date: |
Mon, 4 Mar 2024 13:28:40 +0100 |
It will simplify the changes coming after.
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
hw/vfio/common.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index
8fa232538d482f094643e0f1601b8ebe25fe077f..3c01b4c78ac73665d3c9f2322291a19ef8f71e76
100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -1239,16 +1239,20 @@ static void vfio_iommu_map_dirty_notify(IOMMUNotifier
*n, IOMMUTLBEntry *iotlb)
}
rcu_read_lock();
- if (vfio_get_xlat_addr(iotlb, NULL, &translated_addr, NULL)) {
- ret = vfio_get_dirty_bitmap(bcontainer, iova, iotlb->addr_mask + 1,
- translated_addr);
- if (ret) {
- error_report("vfio_iommu_map_dirty_notify(%p, 0x%"HWADDR_PRIx", "
- "0x%"HWADDR_PRIx") = %d (%s)",
- bcontainer, iova, iotlb->addr_mask + 1, ret,
- strerror(-ret));
- }
+ if (!vfio_get_xlat_addr(iotlb, NULL, &translated_addr, NULL)) {
+ goto out_lock;
}
+
+ ret = vfio_get_dirty_bitmap(bcontainer, iova, iotlb->addr_mask + 1,
+ translated_addr);
+ if (ret) {
+ error_report("vfio_iommu_map_dirty_notify(%p, 0x%"HWADDR_PRIx", "
+ "0x%"HWADDR_PRIx") = %d (%s)",
+ bcontainer, iova, iotlb->addr_mask + 1, ret,
+ strerror(-ret));
+ }
+
+out_lock:
rcu_read_unlock();
out:
--
2.44.0
- Re: [PATCH v3 14/26] memory: Add Error** argument to .log_global*() handlers, (continued)
- [PATCH v3 12/26] migration: Add Error** argument to .save_setup() handler, Cédric Le Goater, 2024/03/04
- [PATCH v3 17/26] vfio: Add Error** argument to .set_dirty_page_tracking() handler, Cédric Le Goater, 2024/03/04
- [PATCH v3 19/26] vfio: Add Error** argument to vfio_devices_dma_logging_stop(), Cédric Le Goater, 2024/03/04
- [PATCH v3 11/26] migration: Add Error** argument to qemu_savevm_state_setup(), Cédric Le Goater, 2024/03/04
- [PATCH v3 15/26] memory: Add Error** argument to the global_dirty_log routines, Cédric Le Goater, 2024/03/04
- [PATCH v3 16/26] migration: Modify ram_init_bitmaps() to report dirty tracking errors, Cédric Le Goater, 2024/03/04
- [PATCH v3 22/26] vfio: Reverse test on vfio_get_dirty_bitmap(),
Cédric Le Goater <=
- [PATCH v3 25/26] vfio: Also trace event failures in vfio_save_complete_precopy(), Cédric Le Goater, 2024/03/04
- [PATCH v3 26/26] vfio: Extend vfio_set_migration_error() with Error* argument, Cédric Le Goater, 2024/03/04
- [PATCH v3 20/26] vfio: Use new Error** argument in vfio_save_setup(), Cédric Le Goater, 2024/03/04
- [PATCH v3 18/26] vfio: Add Error** argument to vfio_devices_dma_logging_start(), Cédric Le Goater, 2024/03/04
- [PATCH v3 24/26] vfio: Add Error** argument to .get_dirty_bitmap() handler, Cédric Le Goater, 2024/03/04
- [PATCH v3 23/26] memory: Add Error** argument to memory_get_xlat_addr(), Cédric Le Goater, 2024/03/04
- [PATCH v3 21/26] vfio: Add Error** argument to .vfio_save_config() handler, Cédric Le Goater, 2024/03/04
- Re: [PATCH v3 00/26] migration: Improve error reporting, Peter Xu, 2024/03/05