diff options
author | Cédric Le Goater <clg@redhat.com> | 2024-03-20 07:49:05 +0100 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-04-23 18:36:01 -0400 |
commit | 3688fec8923101b3a44acde7f3db59b76f82b838 (patch) | |
tree | c24798c11326ab3e97313d5bbee60f2577a1120e /hw/vfio | |
parent | e4fa064d5610a96e50b49c1ea34c98ef12d0034a (diff) | |
download | qemu-3688fec8923101b3a44acde7f3db59b76f82b838.zip qemu-3688fec8923101b3a44acde7f3db59b76f82b838.tar.gz qemu-3688fec8923101b3a44acde7f3db59b76f82b838.tar.bz2 |
memory: Add Error** argument to .log_global_start() handler
Modify all .log_global_start() handlers to take an Error** parameter
and return a bool. Adapt memory_global_dirty_log_start() to interrupt
on the first error the loop on handlers. In such case, a rollback is
performed to stop dirty logging on all listeners where it was
previously enabled.
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Paul Durrant <paul@xen.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20240320064911.545001-10-clg@redhat.com
[peterx: modify & enrich the comment for listener_add_address_space() ]
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r-- | hw/vfio/common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 011ceaa..8f9cbdc 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1066,7 +1066,8 @@ out: return ret; } -static void vfio_listener_log_global_start(MemoryListener *listener) +static bool vfio_listener_log_global_start(MemoryListener *listener, + Error **errp) { VFIOContainerBase *bcontainer = container_of(listener, VFIOContainerBase, listener); @@ -1083,6 +1084,7 @@ static void vfio_listener_log_global_start(MemoryListener *listener) ret, strerror(-ret)); vfio_set_migration_error(ret); } + return !ret; } static void vfio_listener_log_global_stop(MemoryListener *listener) |