All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Subject: [GIT PULL 1/8] migration: add migration_guest_ram_loading() helper
Date: Tue, 30 Jun 2026 19:13:16 +0400	[thread overview]
Message-ID: <20260630-dump-v1-1-7df3087dffc9@redhat.com> (raw)
In-Reply-To: <20260630-dump-v1-0-7df3087dffc9@redhat.com>

From: "Denis V. Lunev" <den@openvz.org>

Operations that read guest RAM (dump-guest-memory, memsave, pmemsave)
must refuse to run while the destination of a migration is still
receiving that RAM: during precopy it is incomplete, and during postcopy
a read faults the page in from the source. Provide a single predicate
they can share instead of open-coding the runstate and postcopy checks.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260619101834.228432-2-den@openvz.org>
---
 include/migration/misc.h | 3 +++
 migration/migration.c    | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/include/migration/misc.h b/include/migration/misc.h
index 3159a5e53c3..d3d6e1f50d1 100644
--- a/include/migration/misc.h
+++ b/include/migration/misc.h
@@ -117,6 +117,9 @@ void migration_file_set_error(int ret, Error *err);
 /* True if incoming migration entered POSTCOPY_INCOMING_DISCARD */
 bool migration_in_incoming_postcopy(void);
 
+/* True while the destination still receives guest RAM (precopy or postcopy) */
+bool migration_guest_ram_loading(void);
+
 /* True if incoming migration entered POSTCOPY_INCOMING_ADVISE */
 bool migration_incoming_postcopy_advised(void);
 
diff --git a/migration/migration.c b/migration/migration.c
index 278cad502ae..0f56432d903 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1643,6 +1643,12 @@ bool migration_in_incoming_postcopy(void)
     return ps >= POSTCOPY_INCOMING_DISCARD && ps < POSTCOPY_INCOMING_END;
 }
 
+bool migration_guest_ram_loading(void)
+{
+    return runstate_check(RUN_STATE_INMIGRATE) ||
+           migration_in_incoming_postcopy();
+}
+
 bool migration_incoming_postcopy_advised(void)
 {
     PostcopyState ps = postcopy_state_get();

-- 
2.54.0



  reply	other threads:[~2026-06-30 15:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 15:13 [GIT PULL 0/8] Dump patches for 2026-06-30 Marc-André Lureau
2026-06-30 15:13 ` Marc-André Lureau [this message]
2026-06-30 15:13 ` [GIT PULL 2/8] dump: refuse dump-guest-memory while guest RAM is being migrated Marc-André Lureau
2026-06-30 15:13 ` [GIT PULL 3/8] system/cpus: refuse memsave/pmemsave " Marc-André Lureau
2026-06-30 15:13 ` [GIT PULL 4/8] dump: make win_dump_available() check vmcoreinfo for a Windows dump header Marc-André Lureau
2026-06-30 15:13 ` [GIT PULL 5/8] tests/qtest: add dump-guest-memory test Marc-André Lureau
2026-06-30 15:13 ` [GIT PULL 6/8] tests/qtest/dump: reject win-dmp without vmcoreinfo Marc-André Lureau
2026-06-30 15:13 ` [GIT PULL 7/8] tests/qtest/dump: cover win-dmp availability via vmcoreinfo Marc-André Lureau
2026-06-30 15:13 ` [GIT PULL 8/8] dump: fix misleading VMCOREINFO phys_base parse error Marc-André Lureau
2026-07-02 18:49 ` [GIT PULL 0/8] Dump patches for 2026-06-30 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=20260630-dump-v1-1-7df3087dffc9@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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.