qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 13/21] migration/rdma: Unfold ram_control_before_iterate()


From: Daniel P . Berrangé
Subject: Re: [PULL 13/21] migration/rdma: Unfold ram_control_before_iterate()
Date: Thu, 1 Jun 2023 09:57:59 +0100
User-agent: Mutt/2.2.9 (2022-11-12)

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 <peterx@redhat.com>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> Message-Id: <20230509120700.78359-3-quintela@redhat.com>
> ---
>  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 :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]