[PATCH v2 0/2] qemu: Don't accept VIR_DUMP_LIVE flag in qemuDomainCoreDumpWithFormat()

This is a v2 of: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/PP7KR... Instead of documenting the flag quirks, let's just error out if specified. Michal Prívozník (2): qemu: Don't accept VIR_DUMP_LIVE flag in qemuDomainCoreDumpWithFormat() NEWS: Document removal of support of VIR_DUMP_LIVE flag from QEMU driver NEWS.rst | 7 +++++++ src/qemu/qemu_driver.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> QEMU can't really do live dumps of guest memory. It's because inside of dump_init() the vm_stop() is called basically unconditionally (the only condition is whether vCPUs are running). Hence, there is no way for us to do live dumps and thus honor VIR_DUMP_LIVE flag. Instead of silently pretending the flag works, reject it with appropriate error message. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/646 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index aef313ae9c..b3b0ee66f8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3162,7 +3162,7 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom, int ret = -1; virObjectEvent *event = NULL; - virCheckFlags(VIR_DUMP_LIVE | VIR_DUMP_CRASH | + virCheckFlags(VIR_DUMP_CRASH | VIR_DUMP_BYPASS_CACHE | VIR_DUMP_RESET | VIR_DUMP_MEMORY_ONLY, -1); -- 2.49.0

On Tue, Jun 03, 2025 at 10:03:12AM +0200, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mprivozn@redhat.com>
QEMU can't really do live dumps of guest memory. It's because inside of dump_init() the vm_stop() is called basically unconditionally (the only condition is whether vCPUs are running). Hence, there is no way for us to do live dumps and thus honor VIR_DUMP_LIVE flag. Instead of silently pretending the flag works, reject it with appropriate error message.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/646 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

From: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- NEWS.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 160aac0b31..b97f86ffb6 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -15,6 +15,13 @@ v11.5.0 (unreleased) * **Removed features** + * qemu: Don't accept VIR_DUMP_LIVE flag in virDomainCoreDumpWithFormat() + + Unfortunately, QEMU always pauses vCPUs when doing a core dump. Therefore, + there is no way for Libvirt to honor VIR_DUMP_LIVE flag semantics. Instead + of silently pretending the flag works, an appropriate error is now + reported. + * **New features** * **Improvements** -- 2.49.0

On Tue, Jun 03, 2025 at 10:03:13AM +0200, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- NEWS.rst | 7 +++++++ 1 file changed, 7 insertions(+)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Daniel P. Berrangé
-
Michal Privoznik