diff mbox series

[PULL,30/30] multifd: Allocate uint64_t instead of ram_addr_t

Message ID 20200114113926.3556-31-quintela@redhat.com
State New
Headers show
Series [PULL,01/30] multifd: Initialize local variable | expand

Commit Message

Juan Quintela Jan. 14, 2020, 11:39 a.m. UTC
We receive that value over the network, and ram_addr_t depends of
architecture.  Just make enough space for 64bit.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/ram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel P. Berrangé Jan. 14, 2020, 12:02 p.m. UTC | #1
On Tue, Jan 14, 2020 at 12:39:26PM +0100, Juan Quintela wrote:
> We receive that value over the network, and ram_addr_t depends of
> architecture.  Just make enough space for 64bit.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration/ram.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> 
> diff --git a/migration/ram.c b/migration/ram.c
> index d0940387d1..ba6e0eea15 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1267,7 +1267,7 @@ int multifd_save_setup(void)
>          p->id = i;
>          p->pages = multifd_pages_init(page_count);
>          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->magic = cpu_to_be32(MULTIFD_MAGIC);
>          p->packet->version = cpu_to_be32(MULTIFD_VERSION);

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

but I think this ought to be patch 2 in the series, otherwise the
multifd test case that's introduced at the start of this series
will likely fail when doing git bisect.

Regards,
Daniel
diff mbox series

Patch

diff --git a/migration/ram.c b/migration/ram.c
index d0940387d1..ba6e0eea15 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1267,7 +1267,7 @@  int multifd_save_setup(void)
         p->id = i;
         p->pages = multifd_pages_init(page_count);
         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->magic = cpu_to_be32(MULTIFD_MAGIC);
         p->packet->version = cpu_to_be32(MULTIFD_VERSION);