[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V2 03/11] migration: convert to NotifierWithReturn
From: |
Peter Xu |
Subject: |
Re: [PATCH V2 03/11] migration: convert to NotifierWithReturn |
Date: |
Mon, 15 Jan 2024 14:44:20 +0800 |
On Fri, Jan 12, 2024 at 07:05:02AM -0800, Steve Sistare wrote:
> Change all migration notifiers to type NotifierWithReturn, so notifiers
> can return an error status in a future patch. For now, pass NULL for the
> notifier error parameter, and do not check the return value.
>
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> ---
> hw/net/virtio-net.c | 4 +++-
> hw/vfio/migration.c | 4 +++-
> include/hw/vfio/vfio-common.h | 2 +-
> include/hw/virtio/virtio-net.h | 2 +-
> include/migration/misc.h | 6 +++---
> migration/migration.c | 16 ++++++++--------
> net/vhost-vdpa.c | 6 ++++--
> ui/spice-core.c | 8 +++++---
> 8 files changed, 28 insertions(+), 20 deletions(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 7a2846f..9570353 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3529,11 +3529,13 @@ static void
> virtio_net_handle_migration_primary(VirtIONet *n, MigrationState *s)
> }
> }
>
> -static void virtio_net_migration_state_notifier(Notifier *notifier, void
> *data)
> +static int virtio_net_migration_state_notifier(NotifierWithReturn *notifier,
> + void *data, Error **errp)
> {
> MigrationState *s = data;
> VirtIONet *n = container_of(notifier, VirtIONet, migration_state);
> virtio_net_handle_migration_primary(n, s);
> + return 0;
> }
I should have mentioned this earlier.. we have a trend recently to modify
retval to boolean when Error** existed, e.g.:
https://lore.kernel.org/all/20231017202633.296756-5-peterx@redhat.com/
Let's start using boolean too here? Previous patches may need touch-ups
too for this.
Other than that it all looks good here. Thanks,
--
Peter Xu
- Re: [PATCH V2 04/11] migration: remove migration_in_postcopy parameter, (continued)
- [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended, Steve Sistare, 2024/01/12
- Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended, Peter Xu, 2024/01/15
- Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended, Steven Sistare, 2024/01/16
- Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended, Steven Sistare, 2024/01/16
- Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended, Peter Xu, 2024/01/17
- Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended, Steven Sistare, 2024/01/17
- Re: [PATCH V2 11/11] vfio: allow cpr-reboot migration if suspended, Peter Xu, 2024/01/17
[PATCH V2 03/11] migration: convert to NotifierWithReturn, Steve Sistare, 2024/01/12
- Re: [PATCH V2 03/11] migration: convert to NotifierWithReturn,
Peter Xu <=
[PATCH V2 07/11] migration: per-mode notifiers, Steve Sistare, 2024/01/12
Re: [PATCH V2 00/11] allow cpr-reboot for vfio, Alex Williamson, 2024/01/12
Re: [PATCH V2 00/11] allow cpr-reboot for vfio, David Hildenbrand, 2024/01/15