[Qemu-devel] [PATCH] migration: move port_attr inside CONFIG_LINUX

Alex Bennée posted 1 patch 4 years, 10 months ago
Test checkpatch passed
Test s390x passed
Test asan passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190701164732.30518-1-alex.bennee@linaro.org
migration/rdma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[Qemu-devel] [PATCH] migration: move port_attr inside CONFIG_LINUX
Posted by Alex Bennée 4 years, 10 months ago
Otherwise the FreeBSD compiler complains about an unused variable.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 migration/rdma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index 74cb2aa9f9..3036221ee8 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -839,10 +839,9 @@ static void qemu_rdma_dump_gid(const char *who, struct rdma_cm_id *id)
  */
 static int qemu_rdma_broken_ipv6_kernel(struct ibv_context *verbs, Error **errp)
 {
-    struct ibv_port_attr port_attr;
-
     /* This bug only exists in linux, to our knowledge. */
 #ifdef CONFIG_LINUX
+    struct ibv_port_attr port_attr;
 
     /*
      * Verbs are only NULL if management has bound to '[::]'.
-- 
2.20.1


Re: [Qemu-devel] [PATCH] migration: move port_attr inside CONFIG_LINUX
Posted by Philippe Mathieu-Daudé 4 years, 9 months ago
On 7/1/19 6:47 PM, Alex Bennée wrote:
> Otherwise the FreeBSD compiler complains about an unused variable.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  migration/rdma.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 74cb2aa9f9..3036221ee8 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -839,10 +839,9 @@ static void qemu_rdma_dump_gid(const char *who, struct rdma_cm_id *id)
>   */
>  static int qemu_rdma_broken_ipv6_kernel(struct ibv_context *verbs, Error **errp)
>  {
> -    struct ibv_port_attr port_attr;
> -
>      /* This bug only exists in linux, to our knowledge. */
>  #ifdef CONFIG_LINUX
> +    struct ibv_port_attr port_attr;
>  
>      /*
>       * Verbs are only NULL if management has bound to '[::]'.
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Re: [Qemu-devel] [PATCH] migration: move port_attr inside CONFIG_LINUX
Posted by Peter Maydell 4 years, 10 months ago
On Mon, 1 Jul 2019 at 17:47, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> Otherwise the FreeBSD compiler complains about an unused variable.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  migration/rdma.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 74cb2aa9f9..3036221ee8 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -839,10 +839,9 @@ static void qemu_rdma_dump_gid(const char *who, struct rdma_cm_id *id)
>   */
>  static int qemu_rdma_broken_ipv6_kernel(struct ibv_context *verbs, Error **errp)
>  {
> -    struct ibv_port_attr port_attr;
> -
>      /* This bug only exists in linux, to our knowledge. */
>  #ifdef CONFIG_LINUX
> +    struct ibv_port_attr port_attr;
>
>      /*
>       * Verbs are only NULL if management has bound to '[::]'.
> --
> 2.20.1

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM