From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Subject: [GIT PULL 2/8] dump: refuse dump-guest-memory while guest RAM is being migrated
Date: Tue, 30 Jun 2026 19:13:17 +0400 [thread overview]
Message-ID: <20260630-dump-v1-2-7df3087dffc9@redhat.com> (raw)
In-Reply-To: <20260630-dump-v1-0-7df3087dffc9@redhat.com>
From: "Denis V. Lunev" <den@openvz.org>
dump-guest-memory reads all of guest RAM. The existing guard only rejects
the dump in RUN_STATE_INMIGRATE, i.e. the precopy load phase. On a
postcopy destination the guest already runs (RUN_STATE_RUNNING) while its
pages are pulled from the source on demand.
A non-detached dump reads that RAM on the main thread with the BQL held.
Touching a not-yet-received page blocks on the userfault, and because the
postcopy incoming path itself takes the BQL to install pages, the
transfer that would satisfy the fault cannot progress: the VM deadlocks.
Use migration_guest_ram_loading(), which also covers postcopy, so the
dump is refused for the whole time the destination is still receiving
guest RAM.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260619101834.228432-3-den@openvz.org>
---
dump/dump.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dump/dump.c b/dump/dump.c
index eb2ee1c10df..7fa2d6f788c 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -30,6 +30,7 @@
#include "qemu/main-loop.h"
#include "hw/misc/vmcoreinfo.h"
#include "migration/blocker.h"
+#include "migration/misc.h"
#include "hw/core/cpu.h"
#include "win_dump.h"
#include "qemu/range.h"
@@ -2080,8 +2081,8 @@ void qmp_dump_guest_memory(bool paging, const char *protocol,
bool detach_p = false;
bool kdump_raw = false;
- if (runstate_check(RUN_STATE_INMIGRATE)) {
- error_setg(errp, "Dump not allowed during incoming migration.");
+ if (migration_guest_ram_loading()) {
+ error_setg(errp, "Dump not allowed during migration.");
return;
}
--
2.54.0
next prev parent 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 ` [GIT PULL 1/8] migration: add migration_guest_ram_loading() helper Marc-André Lureau
2026-06-30 15:13 ` Marc-André Lureau [this message]
2026-06-30 15:13 ` [GIT PULL 3/8] system/cpus: refuse memsave/pmemsave while guest RAM is being migrated 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-2-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.