On Tue, May 30, 2023 at 08:25:23PM +0200, Juan Quintela wrote:
> Once there:
> - Remove unused data parameter
> - unfold it in its callers.
> - change all callers to call qemu_rdma_registration_start()
>
> Reviewed-by: Peter Xu <[email protected]>
> Signed-off-by: Juan Quintela <[email protected]>
> Message-Id: <[email protected]>
> ---
> migration/qemu-file.h | 2 --
> migration/rdma.h | 7 +++++++
> migration/qemu-file.c | 13 +------------
> migration/ram.c | 16 +++++++++++++---
> migration/rdma.c | 6 ++----
> 5 files changed, 23 insertions(+), 21 deletions(-)
> diff --git a/migration/rdma.c b/migration/rdma.c
> index c11863e614..6ca89ff090 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -3863,13 +3863,12 @@ static int rdma_load_hook(QEMUFile *f, uint64_t
> flags, void *data)
> }
> }
>
> -static int qemu_rdma_registration_start(QEMUFile *f,
> - uint64_t flags, void *data)
> +int qemu_rdma_registration_start(QEMUFile *f, uint64_t flags)
> {
> QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(qemu_file_get_ioc(f));
This is cast the migration QIOChannel to a QIOChannelRDMA....
> RDMAContext *rdma;
>
> - if (migration_in_postcopy()) {
> + if (!migrate_rdma () || migration_in_postcopy()) {
....before the code checks whether this is an RDMA migration.
This looks unsafe.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|