[PATCH 18/52] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error

Markus Armbruster posted 52 patches 11 months, 3 weeks ago
Maintainers: Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>, Leonardo Bras <leobras@redhat.com>
There is a newer version of this series
[PATCH 18/52] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error
Posted by Markus Armbruster 11 months, 3 weeks ago
qemu_rdma_resolve_host() and qemu_rdma_dest_init() try addresses until
they find on that works.  If none works, they return the first Error
set by qemu_rdma_broken_ipv6_kernel(), or else return a generic one.

qemu_rdma_broken_ipv6_kernel() neglects to set an Error when
ibv_open_device() fails.  If a later address fails differently, we use
that Error instead, or else the generic one.  Harmless enough, but
needs fixing all the same.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 migration/rdma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/migration/rdma.c b/migration/rdma.c
index be66f53489..08cd186385 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -855,6 +855,8 @@ static int qemu_rdma_broken_ipv6_kernel(struct ibv_context *verbs, Error **errp)
                 if (errno == EPERM) {
                     continue;
                 } else {
+                    error_setg_errno(errp, errno,
+                                     "could not open RDMA device context");
                     return -EINVAL;
                 }
             }
-- 
2.41.0
Re: [PATCH 18/52] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error
Posted by Zhijian Li (Fujitsu) 11 months, 3 weeks ago

On 18/09/2023 22:41, Markus Armbruster wrote:
> qemu_rdma_resolve_host() and qemu_rdma_dest_init() try addresses until
> they find on that works.  If none works, they return the first Error
> set by qemu_rdma_broken_ipv6_kernel(), or else return a generic one.
> 
> qemu_rdma_broken_ipv6_kernel() neglects to set an Error when
> ibv_open_device() fails.  If a later address fails differently, we use
> that Error instead, or else the generic one.  Harmless enough, but
> needs fixing all the same.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Wow... IPV6 + RDMA, i have never used it, though

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>



> ---
>   migration/rdma.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index be66f53489..08cd186385 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -855,6 +855,8 @@ static int qemu_rdma_broken_ipv6_kernel(struct ibv_context *verbs, Error **errp)
>                   if (errno == EPERM) {
>                       continue;
>                   } else {
> +                    error_setg_errno(errp, errno,
> +                                     "could not open RDMA device context");
>                       return -EINVAL;
>                   }
>               }
Re: [PATCH 18/52] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error
Posted by Fabiano Rosas 11 months, 3 weeks ago
Markus Armbruster <armbru@redhat.com> writes:

> qemu_rdma_resolve_host() and qemu_rdma_dest_init() try addresses until
> they find on that works.  If none works, they return the first Error
> set by qemu_rdma_broken_ipv6_kernel(), or else return a generic one.
>
> qemu_rdma_broken_ipv6_kernel() neglects to set an Error when
> ibv_open_device() fails.  If a later address fails differently, we use
> that Error instead, or else the generic one.  Harmless enough, but
> needs fixing all the same.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Fabiano Rosas <farosas@suse.de>