From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Peter Xu <peterx@redhat.com>,
Eric Blake <eblake@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
"Dr. David Alan Gilbert" <dave@treblig.org>,
Markus Armbruster <armbru@redhat.com>,
Leonardo Bras <leobras@redhat.com>,
qemu-block@nongnu.org, Hailiang Zhang <zhanghailiang@xfusion.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Juan Quintela <quintela@redhat.com>,
Lukas Straub <lukasstraub2@web.de>
Subject: [PULL 03/10] multifd: Add the ramblock to MultiFDRecvParams
Date: Wed, 10 May 2023 20:09:31 +0200 [thread overview]
Message-ID: <20230510180938.6338-4-quintela@redhat.com> (raw)
In-Reply-To: <20230510180938.6338-1-quintela@redhat.com>
From: Lukas Straub <lukasstraub2@web.de>
This will be used in the next commits to add colo support to multifd.
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <88135197411df1a71d7832962b39abf60faf0021.1683572883.git.lukasstraub2@web.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/multifd.h | 2 ++
migration/multifd.c | 11 +++++------
2 files changed, 7 insertions(+), 6 deletions(-)
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 */
diff --git a/migration/multifd.c b/migration/multifd.c
index 4e71c19292..5c4298eadf 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -281,7 +281,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);
@@ -331,21 +330,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;
--
2.40.1
next prev parent reply other threads:[~2023-05-10 18:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 18:09 [PULL 00/10] Migration 20230509 patches Juan Quintela
2023-05-10 18:09 ` [PULL 01/10] ram: Add public helper to set colo bitmap Juan Quintela
2023-05-10 18:09 ` [PULL 02/10] ram: Let colo_flush_ram_cache take the bitmap_mutex Juan Quintela
2023-05-10 18:09 ` Juan Quintela [this message]
2023-05-10 18:09 ` [PULL 04/10] block/meson.build: prefer positive condition for replication Juan Quintela
2023-05-10 18:09 ` [PULL 05/10] colo: make colo_checkpoint_notify static and provide simpler API Juan Quintela
2023-05-10 18:09 ` [PULL 06/10] build: move COLO under CONFIG_REPLICATION Juan Quintela
2023-05-10 18:09 ` [PULL 07/10] migration: drop colo_incoming_thread from MigrationIncomingState Juan Quintela
2023-05-10 18:09 ` [PULL 08/10] migration: process_incoming_migration_co: simplify code flow around ret Juan Quintela
2023-05-10 18:09 ` [PULL 09/10] migration: disallow change capabilities in COLO state Juan Quintela
2023-05-10 18:09 ` [PULL 10/10] migration: block incoming colo when capability is disabled Juan Quintela
2023-05-11 7:58 ` [PULL 00/10] Migration 20230509 patches Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
2023-05-09 19:17 Juan Quintela
2023-05-09 19:17 ` [PULL 03/10] multifd: Add the ramblock to MultiFDRecvParams Juan Quintela
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=20230510180938.6338-4-quintela@redhat.com \
--to=quintela@redhat.com \
--cc=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=leobras@redhat.com \
--cc=lukasstraub2@web.de \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=zhanghailiang@xfusion.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 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).