From: Juan Quintela <quintela@redhat.com>
To: Lukas Straub <lukasstraub2@web.de>
Cc: qemu-devel <qemu-devel@nongnu.org>, Peter Xu <peterx@redhat.com>,
Leonardo Bras <leobras@redhat.com>
Subject: Re: [PATCH 5/5] multifd: Add colo support
Date: Mon, 08 May 2023 17:13:01 +0200 [thread overview]
Message-ID: <878rdy6ema.fsf@secure.mitica> (raw)
In-Reply-To: <6461809211524b24210fd4ac2ea6b2593fc7538f.1683506133.git.lukasstraub2@web.de> (Lukas Straub's message of "Mon, 8 May 2023 02:52:59 +0200")
Lukas Straub <lukasstraub2@web.de> wrote:
> Signed-off-by: Lukas Straub <lukasstraub2@web.de>
> ---
Please, split the move the creation of the p->block and the rest of the patch.
> diff --git a/migration/multifd.c b/migration/multifd.c
> index fb5e8859de..fddbf86596 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -284,7 +284,6 @@ static void multifd_send_fill_packet(MultiFDSendParams *p)
> static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
> {
> MultiFDPacket_t *packet = p->packet;
> - RAMBlock *block;
> int i;
>
> packet->magic = be32_to_cpu(packet->magic);
> @@ -334,21 +333,21 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
>
> /* make sure that ramblock is 0 terminated */
> packet->ramblock[255] = 0;
> - block = qemu_ram_block_by_name(packet->ramblock);
> - if (!block) {
> + p->block = qemu_ram_block_by_name(packet->ramblock);
> + if (!p->block) {
> error_setg(errp, "multifd: unknown ram block %s",
> packet->ramblock);
> return -1;
> }
>
> - p->host = block->host;
> + p->host = p->block->host;
> for (i = 0; i < p->normal_num; i++) {
> uint64_t offset = be64_to_cpu(packet->offset[i]);
>
> - if (offset > (block->used_length - p->page_size)) {
> + if (offset > (p->block->used_length - p->page_size)) {
> error_setg(errp, "multifd: offset too long %" PRIu64
> " (max " RAM_ADDR_FMT ")",
> - offset, block->used_length);
> + offset, p->block->used_length);
> return -1;
> }
> p->normal[i] = offset;
> diff --git a/migration/multifd.h b/migration/multifd.h
> index 7cfc265148..a835643b48 100644
> --- a/migration/multifd.h
> +++ b/migration/multifd.h
> @@ -175,6 +175,8 @@ typedef struct {
> uint32_t next_packet_size;
> /* packets sent through this channel */
> uint64_t num_packets;
> + /* ramblock */
> + RAMBlock *block;
> /* ramblock host address */
> uint8_t *host;
> /* non zero pages recv through this channel */
next prev parent reply other threads:[~2023-05-08 15:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 0:51 [PATCH 0/5] multifd: Add colo support Lukas Straub
2023-05-08 0:52 ` [PATCH 1/5] ram: Add public helper to set colo bitmap Lukas Straub
2023-05-08 0:52 ` [PATCH 2/5] ram: Let colo_flush_ram_cache take the bitmap_mutex Lukas Straub
2023-05-08 0:52 ` [PATCH 3/5] multifd: Introduce multifd-internal.h Lukas Straub
2023-05-08 0:52 ` [PATCH 4/5] multifd: Introduce a overridable revc_pages method Lukas Straub
2023-05-08 0:52 ` [PATCH 5/5] multifd: Add colo support Lukas Straub
2023-05-08 15:13 ` Juan Quintela [this message]
2023-05-08 1:38 ` [PATCH 0/5] " Peter Xu
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=878rdy6ema.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=leobras@redhat.com \
--cc=lukasstraub2@web.de \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).