[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/13] migration: Fix some 32 bit compiler errors
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 03/13] migration: Fix some 32 bit compiler errors |
Date: |
Tue, 17 Mar 2015 16:30:25 +0100 |
From: Stefan Weil <address@hidden>
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 <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/rdma.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index 5dd4863..a52e96a 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1103,7 +1103,7 @@ static int qemu_rdma_search_ram_block(RDMAContext *rdma,
* to perform the actual RDMA operation.
*/
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,
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]) {
perror("Failed to register chunk!");
fprintf(stderr, "Chunk details: block: %d chunk index %d"
- " start %" PRIu64 " end %" PRIu64 " host %" PRIu64
- " local %" PRIu64 " registrations: %d\n",
- block->index, chunk, (uint64_t) chunk_start,
- (uint64_t) chunk_end, (uint64_t) host_addr,
- (uint64_t) block->local_host_addr,
+ " start %" PRIuPTR " end %" PRIuPTR
+ " host %" PRIuPTR
+ " local %" PRIuPTR " registrations: %d\n",
+ block->index, chunk, (uintptr_t)chunk_start,
+ (uintptr_t)chunk_end, host_addr,
+ (uintptr_t)block->local_host_addr,
rdma->total_registrations);
return -1;
}
@@ -1931,8 +1932,7 @@ retry:
}
/* try to overlap this single registration with the one we sent. */
- 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,
chunk_start, chunk_end)) {
error_report("cannot get lkey");
@@ -1951,8 +1951,7 @@ retry:
block->remote_host_addr = reg_result->host_addr;
} else {
/* already registered before */
- 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,
chunk_start, chunk_end)) {
error_report("cannot get lkey!");
@@ -1964,7 +1963,7 @@ retry:
} else {
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,
chunk_start, chunk_end)) {
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_end = ram_chunk_end(block, chunk + reg->chunks);
if (qemu_rdma_register_and_get_keys(rdma, block,
- (uint8_t *)host_addr, NULL, ®_result->rkey,
+ (uintptr_t)host_addr, NULL, ®_result->rkey,
chunk, chunk_start, chunk_end)) {
error_report("cannot get rkey");
ret = -EINVAL;
--
2.1.0
- [Qemu-devel] [PULL 00/13] migration pull queue, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 03/13] migration: Fix some 32 bit compiler errors,
Juan Quintela <=
- [Qemu-devel] [PULL 01/13] migration: Avoid qerror_report_err() outside QMP command handlers, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 06/13] Warn against the use of the string as uri parameter to migrate-incoming, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 02/13] migration/rdma: clean up qemu_rdma_dest_init a bit, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 04/13] migration: Fix remaining 32 bit compiler errors, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 05/13] migrate_incoming: use hmp_handle_error, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 07/13] migrate_incoming: Cleanup/clarify error messages, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 10/13] migration: Rename abbreviated macro MIG_STATE_* to MIGRATION_STATUS_*, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 09/13] migration: Remove unused functions, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 12/13] migration: Convert 'status' of MigrationInfo to use an enum type, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 11/13] hmp: Rename 'MigrationStatus' to 'HMPMigrationStatus', Juan Quintela, 2015/03/17