migration: Fix some 32 bit compiler errors

The current code won't compile on 32 bit hosts because there are lots
of type casts between pointers and 64 bit integers.

Fix some of them.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Stefan Weil 2015-02-28 19:09:42 +01:00 committed by Juan Quintela
parent 1dbd2fd9cb
commit 3ac040c0ef

View File

@ -1103,7 +1103,7 @@ static int qemu_rdma_search_ram_block(RDMAContext *rdma,
* to perform the actual RDMA operation. * to perform the actual RDMA operation.
*/ */
static int qemu_rdma_register_and_get_keys(RDMAContext *rdma, static int qemu_rdma_register_and_get_keys(RDMAContext *rdma,
RDMALocalBlock *block, uint8_t *host_addr, RDMALocalBlock *block, uintptr_t host_addr,
uint32_t *lkey, uint32_t *rkey, int chunk, uint32_t *lkey, uint32_t *rkey, int chunk,
uint8_t *chunk_start, uint8_t *chunk_end) uint8_t *chunk_start, uint8_t *chunk_end)
{ {
@ -1140,11 +1140,12 @@ static int qemu_rdma_register_and_get_keys(RDMAContext *rdma,
if (!block->pmr[chunk]) { if (!block->pmr[chunk]) {
perror("Failed to register chunk!"); perror("Failed to register chunk!");
fprintf(stderr, "Chunk details: block: %d chunk index %d" fprintf(stderr, "Chunk details: block: %d chunk index %d"
" start %" PRIu64 " end %" PRIu64 " host %" PRIu64 " start %" PRIuPTR " end %" PRIuPTR
" local %" PRIu64 " registrations: %d\n", " host %" PRIuPTR
block->index, chunk, (uint64_t) chunk_start, " local %" PRIuPTR " registrations: %d\n",
(uint64_t) chunk_end, (uint64_t) host_addr, block->index, chunk, (uintptr_t)chunk_start,
(uint64_t) block->local_host_addr, (uintptr_t)chunk_end, host_addr,
(uintptr_t)block->local_host_addr,
rdma->total_registrations); rdma->total_registrations);
return -1; return -1;
} }
@ -1931,8 +1932,7 @@ retry:
} }
/* try to overlap this single registration with the one we sent. */ /* try to overlap this single registration with the one we sent. */
if (qemu_rdma_register_and_get_keys(rdma, block, if (qemu_rdma_register_and_get_keys(rdma, block, sge.addr,
(uint8_t *) sge.addr,
&sge.lkey, NULL, chunk, &sge.lkey, NULL, chunk,
chunk_start, chunk_end)) { chunk_start, chunk_end)) {
error_report("cannot get lkey"); error_report("cannot get lkey");
@ -1951,8 +1951,7 @@ retry:
block->remote_host_addr = reg_result->host_addr; block->remote_host_addr = reg_result->host_addr;
} else { } else {
/* already registered before */ /* already registered before */
if (qemu_rdma_register_and_get_keys(rdma, block, if (qemu_rdma_register_and_get_keys(rdma, block, sge.addr,
(uint8_t *)sge.addr,
&sge.lkey, NULL, chunk, &sge.lkey, NULL, chunk,
chunk_start, chunk_end)) { chunk_start, chunk_end)) {
error_report("cannot get lkey!"); error_report("cannot get lkey!");
@ -1964,7 +1963,7 @@ retry:
} else { } else {
send_wr.wr.rdma.rkey = block->remote_rkey; send_wr.wr.rdma.rkey = block->remote_rkey;
if (qemu_rdma_register_and_get_keys(rdma, block, (uint8_t *)sge.addr, if (qemu_rdma_register_and_get_keys(rdma, block, sge.addr,
&sge.lkey, NULL, chunk, &sge.lkey, NULL, chunk,
chunk_start, chunk_end)) { chunk_start, chunk_end)) {
error_report("cannot get lkey!"); error_report("cannot get lkey!");
@ -3027,7 +3026,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque,
chunk_start = ram_chunk_start(block, chunk); chunk_start = ram_chunk_start(block, chunk);
chunk_end = ram_chunk_end(block, chunk + reg->chunks); chunk_end = ram_chunk_end(block, chunk + reg->chunks);
if (qemu_rdma_register_and_get_keys(rdma, block, if (qemu_rdma_register_and_get_keys(rdma, block,
(uint8_t *)host_addr, NULL, &reg_result->rkey, (uintptr_t)host_addr, NULL, &reg_result->rkey,
chunk, chunk_start, chunk_end)) { chunk, chunk_start, chunk_end)) {
error_report("cannot get rkey"); error_report("cannot get rkey");
ret = -EINVAL; ret = -EINVAL;