multifd: Be consistent about using uint64_t
We transmit ram_addr_t always as uint64_t. Be consistent in its use (on 64bit system, it is always uint64_t problem is 32bits). Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
4746dbf8a9
commit
ddac5cb2d9
@ -803,7 +803,10 @@ static void multifd_send_fill_packet(MultiFDSendParams *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < p->pages->used; i++) {
|
for (i = 0; i < p->pages->used; i++) {
|
||||||
packet->offset[i] = cpu_to_be64(p->pages->offset[i]);
|
/* there are architectures where ram_addr_t is 32 bit */
|
||||||
|
uint64_t temp = p->pages->offset[i];
|
||||||
|
|
||||||
|
packet->offset[i] = cpu_to_be64(temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -877,10 +880,10 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < p->pages->used; i++) {
|
for (i = 0; i < p->pages->used; i++) {
|
||||||
ram_addr_t offset = be64_to_cpu(packet->offset[i]);
|
uint64_t offset = be64_to_cpu(packet->offset[i]);
|
||||||
|
|
||||||
if (offset > (block->used_length - TARGET_PAGE_SIZE)) {
|
if (offset > (block->used_length - TARGET_PAGE_SIZE)) {
|
||||||
error_setg(errp, "multifd: offset too long " RAM_ADDR_FMT
|
error_setg(errp, "multifd: offset too long %" PRIu64
|
||||||
" (max " RAM_ADDR_FMT ")",
|
" (max " RAM_ADDR_FMT ")",
|
||||||
offset, block->max_length);
|
offset, block->max_length);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1267,7 +1270,7 @@ int multifd_save_setup(void)
|
|||||||
p->id = i;
|
p->id = i;
|
||||||
p->pages = multifd_pages_init(page_count);
|
p->pages = multifd_pages_init(page_count);
|
||||||
p->packet_len = sizeof(MultiFDPacket_t)
|
p->packet_len = sizeof(MultiFDPacket_t)
|
||||||
+ sizeof(ram_addr_t) * page_count;
|
+ sizeof(uint64_t) * page_count;
|
||||||
p->packet = g_malloc0(p->packet_len);
|
p->packet = g_malloc0(p->packet_len);
|
||||||
p->packet->magic = cpu_to_be32(MULTIFD_MAGIC);
|
p->packet->magic = cpu_to_be32(MULTIFD_MAGIC);
|
||||||
p->packet->version = cpu_to_be32(MULTIFD_VERSION);
|
p->packet->version = cpu_to_be32(MULTIFD_VERSION);
|
||||||
@ -1484,7 +1487,7 @@ int multifd_load_setup(void)
|
|||||||
p->id = i;
|
p->id = i;
|
||||||
p->pages = multifd_pages_init(page_count);
|
p->pages = multifd_pages_init(page_count);
|
||||||
p->packet_len = sizeof(MultiFDPacket_t)
|
p->packet_len = sizeof(MultiFDPacket_t)
|
||||||
+ sizeof(ram_addr_t) * page_count;
|
+ sizeof(uint64_t) * page_count;
|
||||||
p->packet = g_malloc0(p->packet_len);
|
p->packet = g_malloc0(p->packet_len);
|
||||||
p->name = g_strdup_printf("multifdrecv_%d", i);
|
p->name = g_strdup_printf("multifdrecv_%d", i);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user