From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: Peter Xu <peterx@redhat.com>, Steve Sistare <steven.sistare@oracle.com>
Subject: [PULL 2/4] pflash: fix cpr
Date: Fri, 14 Mar 2025 11:48:22 -0300 [thread overview]
Message-ID: <20250314144824.1707-3-farosas@suse.de> (raw)
In-Reply-To: <20250314144824.1707-1-farosas@suse.de>
From: Steve Sistare <steven.sistare@oracle.com>
During normal migration, new QEMU creates and initializes memory regions,
then loads the preserved contents of the region from vmstate.
During CPR, memory regions are preserved in place, then the realize
method initializes the regions contents, losing the old contents. To
fix, skip the re-init during CPR.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <1741380954-341079-3-git-send-email-steven.sistare@oracle.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
hw/block/block.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/block/block.c b/hw/block/block.c
index 1d405e02bf..2e10611d95 100644
--- a/hw/block/block.c
+++ b/hw/block/block.c
@@ -12,6 +12,7 @@
#include "system/blockdev.h"
#include "system/block-backend.h"
#include "hw/block/block.h"
+#include "migration/cpr.h"
#include "qapi/error.h"
#include "qapi/qapi-types-block.h"
@@ -66,6 +67,10 @@ bool blk_check_size_and_read_all(BlockBackend *blk, DeviceState *dev,
int ret;
g_autofree char *dev_id = NULL;
+ if (cpr_is_incoming()) {
+ return true;
+ }
+
blk_len = blk_getlength(blk);
if (blk_len < 0) {
error_setg_errno(errp, -blk_len,
--
2.35.3
next prev parent reply other threads:[~2025-03-14 14:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-14 14:48 [PULL 0/4] Migration patches for 2025-03-14 Fabiano Rosas
2025-03-14 14:48 ` [PULL 1/4] migration: cpr_is_incoming Fabiano Rosas
2025-03-14 14:48 ` Fabiano Rosas [this message]
2025-03-14 14:48 ` [PULL 3/4] hw/loader: fix roms during cpr Fabiano Rosas
2025-03-14 14:48 ` [PULL 4/4] hw/qxl: fix cpr Fabiano Rosas
2025-03-16 10:10 ` [PULL 0/4] Migration patches for 2025-03-14 Stefan Hajnoczi
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=20250314144824.1707-3-farosas@suse.de \
--to=farosas@suse.de \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=steven.sistare@oracle.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).