[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V2 05/11] migration: MigrationEvent for notifiers
From: |
Steven Sistare |
Subject: |
Re: [PATCH V2 05/11] migration: MigrationEvent for notifiers |
Date: |
Fri, 12 Jan 2024 10:18:33 -0500 |
User-agent: |
Mozilla Thunderbird |
On 1/12/2024 10:05 AM, Steve Sistare wrote:
> Passing MigrationState to notifiers is unsound because they could access
> unstable migration state internals or even modify the state. Instead, pass
> the minimal info needed in a new MigrationEvent struct, which could be
> extended in the future if needed.
>
> Suggested-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> ---
> [...]
> diff --git a/include/migration/misc.h b/include/migration/misc.h
> index dcc98bb..0b4ce0f 100644
> --- a/include/migration/misc.h
> +++ b/include/migration/misc.h
> @@ -60,6 +60,11 @@ void migration_object_init(void);
> void migration_shutdown(void);
> bool migration_is_idle(void);
> bool migration_is_active(MigrationState *);
> +
> +typedef struct MigrationEvent {
> + MigrationStatus state;
> +} MigrationEvent;
Hi Peter, I chose to pass MigrationStatus rather than define a new enum and map
MigrationStatus to it. IMO a new enum adds little value, yet it is more code
and
another layer of abstraction for coders to grok.
- Steve
- [PATCH V2 00/11] allow cpr-reboot for vfio, Steve Sistare, 2024/01/12
- [PATCH V2 05/11] migration: MigrationEvent for notifiers, Steve Sistare, 2024/01/12
- Re: [PATCH V2 05/11] migration: MigrationEvent for notifiers,
Steven Sistare <=
- [PATCH V2 09/11] migration: notifier error checking, Steve Sistare, 2024/01/12
- [PATCH V2 08/11] migration: refactor migrate_fd_connect failures, Steve Sistare, 2024/01/12
- [PATCH V2 01/11] notify: pass error to notifier with return, Steve Sistare, 2024/01/12
- [PATCH V2 10/11] vfio: register container for cpr, Steve Sistare, 2024/01/12
- [PATCH V2 02/11] migration: remove error from notifier data, Steve Sistare, 2024/01/12
- [PATCH V2 06/11] migration: MigrationNotifyFunc, Steve Sistare, 2024/01/12