From: Wei Yang <richardw.yang@linux.intel.com>
To: quintela@redhat.com, dgilbert@redhat.com
Cc: qemu-devel@nongnu.org, Wei Yang <richardw.yang@linux.intel.com>
Subject: [PATCH 2/4] migration/multifd: use pages->allocated instead of the static max
Date: Fri, 11 Oct 2019 16:50:48 +0800 [thread overview]
Message-ID: <20191011085050.17622-3-richardw.yang@linux.intel.com> (raw)
In-Reply-To: <20191011085050.17622-1-richardw.yang@linux.intel.com>
multifd_send_fill_packet() prepares meta data for following pages to
transfer. It would be more proper to fill pages->allocated instead of
static max value, especially we want to support flexible packet size.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
migration/ram.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index cf30171f44..6a3bef0434 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -791,13 +791,12 @@ static void multifd_pages_clear(MultiFDPages_t *pages)
static void multifd_send_fill_packet(MultiFDSendParams *p)
{
MultiFDPacket_t *packet = p->packet;
- uint32_t page_max = MULTIFD_PACKET_SIZE / qemu_target_page_size();
int i;
packet->magic = cpu_to_be32(MULTIFD_MAGIC);
packet->version = cpu_to_be32(MULTIFD_VERSION);
packet->flags = cpu_to_be32(p->flags);
- packet->pages_alloc = cpu_to_be32(page_max);
+ packet->pages_alloc = cpu_to_be32(p->pages->allocated);
packet->pages_used = cpu_to_be32(p->pages->used);
packet->next_packet_size = cpu_to_be32(p->next_packet_size);
packet->packet_num = cpu_to_be64(p->packet_num);
--
2.17.1
next prev parent reply other threads:[~2019-10-11 8:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 8:50 [PATCH 0/4] migration/multifd: trivial cleanup for multifd Wei Yang
2019-10-11 8:50 ` [PATCH 1/4] migration/multifd: fix a typo in comment of multifd_recv_unfill_packet() Wei Yang
2019-10-11 9:44 ` Juan Quintela
2019-10-11 8:50 ` Wei Yang [this message]
2019-10-11 10:31 ` [PATCH 2/4] migration/multifd: use pages->allocated instead of the static max Juan Quintela
2019-10-11 8:50 ` [PATCH 3/4] migration/multifd: initialize packet->magic/version once at setup stage Wei Yang
2019-10-11 10:20 ` Juan Quintela
2019-10-11 12:17 ` Wei Yang
2019-10-11 8:50 ` [PATCH 4/4] migration/multifd: pages->used would be cleared when attach to multifd_send_state Wei Yang
2019-10-11 10:24 ` Juan Quintela
2019-10-11 14:02 ` [PATCH 0/4] migration/multifd: trivial cleanup for multifd Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191011085050.17622-3-richardw.yang@linux.intel.com \
--to=richardw.yang@linux.intel.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.