hw/rdma: another clang compilation fix
PATCH 1/1 hw/rdma: another clang compilation fix
Configuring QEMU with:
configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma
Results in:
qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition]
} RdmaDeviceResources;
^ qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition is here typedef struct RdmaDeviceResources RdmaDeviceResources;
Fix by removing one of the 'typedef' definitions.
--- hw/rdma/rdma_rm_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/rdma/rdma_rm_defs.h +2 -2
@@ -96,7 +96,7 @@ typedef struct RdmaRmPort {enum ibv_port_state state; } RdmaRmPort; -typedef struct RdmaDeviceResources { +struct RdmaDeviceResources {RdmaRmPort port;RdmaRmResTbl pd_tbl;RdmaRmResTbl mr_tbl;
@@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources {RdmaRmResTbl cq_tbl;RdmaRmResTbl cqe_ctx_tbl; GHashTable *qp_hash; /* Keeps mapping between real and emulated */ -} RdmaDeviceResources; +};#endif
Signature · 1 line
2.17.1
Quoted 31 lines · Marcel Apfelbaum
Configuring QEMU with:
configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma Results in: qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition] } RdmaDeviceResources; ^ qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition is here typedef struct RdmaDeviceResources RdmaDeviceResources;Fix by removing one of the 'typedef' definitions.
Signed-off-by Marcel Apfelbaum <[email protected]>--- hw/rdma/rdma_rm_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/rdma/rdma_rm_defs.h +1
-1@@ -96,7 +96,7 @@ typedef struct RdmaRmPort {enum ibv_port_state state; } RdmaRmPort; -typedef struct RdmaDeviceResources { +struct RdmaDeviceResources {RdmaRmPort port;RdmaRmResTbl pd_tbl;RdmaRmResTbl mr_tbl;
hw/rdma/rdma_rm_defs.h typedef struct RdmaDeviceResources { · line 110
Quoted 7 lines
hw/rdma/rdma_rm_defs.h +1
-1@@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources {RdmaRmResTbl cq_tbl;RdmaRmResTbl cqe_ctx_tbl; GHashTable *qp_hash; /* Keeps mapping between real and emulated */ -} RdmaDeviceResources; +};#endif
Thanks,
Marcel
Quoted 37 lines · Marcel Apfelbaum
Configuring QEMU with:
configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma Results in: qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition] } RdmaDeviceResources; ^ qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition is here typedef struct RdmaDeviceResources RdmaDeviceResources;Fix by removing one of the 'typedef' definitions.
Signed-off-by Marcel Apfelbaum <[email protected]>--- hw/rdma/rdma_rm_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/rdma/rdma_rm_defs.h +2
-2@@ -96,7 +96,7 @@ typedef struct RdmaRmPort {enum ibv_port_state state; } RdmaRmPort; -typedef struct RdmaDeviceResources { +struct RdmaDeviceResources {RdmaRmPort port;RdmaRmResTbl pd_tbl;RdmaRmResTbl mr_tbl;@@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources {RdmaRmResTbl cq_tbl;RdmaRmResTbl cqe_ctx_tbl; GHashTable *qp_hash; /* Keeps mapping between real and emulated */ -} RdmaDeviceResources; +};#endif
Philippe Mathieu-Daudé
Reviewed-byQuoted 2 lines · Marcel Apfelbaum
I doubt this is a security issue worth Cc'ing qemu-stable :)
Quoted 18 lines
Thanks,
MarcelQuoted 14 lines · Marcel Apfelbaum
Configuring QEMU with:
configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma Results in:
qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition] } RdmaDeviceResources;
^
qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition is here
typedef struct RdmaDeviceResources RdmaDeviceResources;Fix by removing one of the 'typedef' definitions.
Signed-off-by Marcel Apfelbaum <[email protected]>
Quoted 25 lines
Quoted 23 lines
---
hw/rdma/rdma_rm_defs.h| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)hw/rdma/rdma_rm_defs.h +1
-0@@ -96,7 +96,7 @@ typedef struct RdmaRmPort { enum ibv_port_state state; } RdmaRmPort; -typedef struct RdmaDeviceResources { +struct RdmaDeviceResources { RdmaRmPort port; RdmaRmResTbl pd_tbl; RdmaRmResTbl mr_tbl;@@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources { RdmaRmResTbl cq_tbl; RdmaRmResTbl cqe_ctx_tbl;GHashTable
*qp_hash; /* Keeps mapping between real and emulated */hw/rdma/rdma_rm_defs.h +1
-1-} RdmaDeviceResources; +};#endif
Hi Philippe,
Quoted 4 lines · Philippe Mathieu-Daudé
Quoted 1 line · Marcel Apfelbaum
I doubt this is a security issue worth Cc'ing qemu-stable :)
I thought it worth adding a compilation fix to the stable branch.
Thanks,
Marcel
Quoted 44 lines
Quoted 18 lines
Thanks,
MarcelQuoted 14 lines · Marcel Apfelbaum
Configuring QEMU with:
configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma
Results in:
qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef
'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition]
} RdmaDeviceResources;
^
qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition
is here
typedef struct RdmaDeviceResources RdmaDeviceResources;Fix by removing one of the 'typedef' definitions.
Signed-off-by Marcel Apfelbaum <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Quoted 24 lines
Quoted 23 lines
--- hw/rdma/rdma_rm_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/rdma/rdma_rm_defs.h +2
-1@@ -96,7 +96,7 @@ typedef struct RdmaRmPort { enum ibv_port_state state; } RdmaRmPort; -typedef struct RdmaDeviceResources { +struct RdmaDeviceResources { RdmaRmPort port; RdmaRmResTbl pd_tbl; RdmaRmResTbl mr_tbl;@@ -105,6 +105,6 @@ typedef struct RdmaDeviceResources { RdmaRmResTbl cq_tbl; RdmaRmResTbl cqe_ctx_tbl; GHashTable *qp_hash; /* Keeps mapping between real and emulated */ -} RdmaDeviceResources; +}; #endif