[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/22] migration/rdma: clang compilation fix
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 04/22] migration/rdma: clang compilation fix |
Date: |
Wed, 6 Mar 2019 11:42:09 +0000 |
From: Marcel Apfelbaum <address@hidden>
Configuring QEMU with:
../configure --cc=clang --enable-rdma
Leads to compilation error:
CC migration/rdma.o
CC migration/block.o
qemu/migration/rdma.c:3615:58: error: taking address of packed member 'rkey'
of class or structure
'RDMARegisterResult' may result in an unaligned pointer value
[-Werror,-Waddress-of-packed-member]
(uintptr_t)host_addr, NULL, ®_result->rkey,
^~~~~~~~~~~~~~~~
Fix it by using a temp local variable.
Signed-off-by: Marcel Apfelbaum <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
migration/rdma.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index 9fa3b176eb..d5251cd820 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3613,13 +3613,16 @@ static int qemu_rdma_registration_handle(QEMUFile *f,
void *opaque)
}
chunk_start = ram_chunk_start(block, chunk);
chunk_end = ram_chunk_end(block, chunk + reg->chunks);
+ /* avoid "-Waddress-of-packed-member" warning */
+ uint32_t tmp_rkey = 0;
if (qemu_rdma_register_and_get_keys(rdma, block,
- (uintptr_t)host_addr, NULL, ®_result->rkey,
+ (uintptr_t)host_addr, NULL, &tmp_rkey,
chunk, chunk_start, chunk_end)) {
error_report("cannot get rkey");
ret = -EINVAL;
goto out;
}
+ reg_result->rkey = tmp_rkey;
reg_result->host_addr = (uintptr_t)block->local_host_addr;
--
2.20.1
- [Qemu-devel] [PULL 00/22] migration queue, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 01/22] migration: Fix cancel state, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 02/22] migration/rdma: Fix qemu_rdma_cleanup null check, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 03/22] migration: Cleanup during exit, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 04/22] migration/rdma: clang compilation fix,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 05/22] exec: Change RAMBlockIterFunc definition, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 06/22] migration: Introduce ignore-shared capability, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 07/22] migration: Add an ability to ignore shared RAM blocks, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 08/22] tests/migration-test: Add a test for ignore-shared capability, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 09/22] migration: Add capabilities validation, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 10/22] tests: Add migration xbzrle test, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 11/22] migration: Create socket-address parameter, Dr. David Alan Gilbert (git), 2019/03/06
- [Qemu-devel] [PULL 12/22] tests: Add basic migration precopy tcp test, Dr. David Alan Gilbert (git), 2019/03/06