[PATCH 0/2] qemu: VM saving related fixes

Peter Krempa (2): qemu: driver: Reformat helpers for saving VM state Properly mark auto-added 'terminator' virStorageSource src/qemu/qemu_domain.c | 4 +++- src/qemu/qemu_driver.c | 11 +++++++---- src/storage_file/storage_source.c | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) -- 2.41.0

Rewrap argument definition of qemuDomainSaveInternal and align argument in the invocation of the aforementioned function in qemuDomainManagedSaveHelper. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_driver.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f20544590d..497923ffee 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2620,9 +2620,12 @@ qemuDomainGetControlInfo(virDomainPtr dom, */ static int qemuDomainSaveInternal(virQEMUDriver *driver, - virDomainObj *vm, const char *path, - int compressed, virCommand *compressor, - const char *xmlin, unsigned int flags) + virDomainObj *vm, + const char *path, + int compressed, + virCommand *compressor, + const char *xmlin, + unsigned int flags) { g_autofree char *xml = NULL; bool was_running = false; @@ -2785,7 +2788,7 @@ qemuDomainManagedSaveHelper(virQEMUDriver *driver, VIR_INFO("Saving state of domain '%s' to '%s'", vm->def->name, path); if (qemuDomainSaveInternal(driver, vm, path, compressed, - compressor, dxml, flags) < 0) + compressor, dxml, flags) < 0) return -1; vm->hasManagedSave = true; -- 2.41.0

On a Friday in 2023, Peter Krempa wrote:
Rewrap argument definition of qemuDomainSaveInternal and align argument in the invocation of the aforementioned function in qemuDomainManagedSaveHelper.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_driver.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

All backing chain members which were auto-added by image detection, including the terminating element, should have the 'detected' property set to true. This is needed to properly strip the detected elements in some cases, e.g. for the status XML where we could treat some images as manually terminated even when it was auto-detected. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_domain.c | 4 +++- src/storage_file/storage_source.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 94587638c3..25d1a0cb1b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7841,8 +7841,10 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver, disksrc->format < VIR_STORAGE_FILE_BACKING) { /* terminate the chain for such images as the code below would do */ - if (!disksrc->backingStore) + if (!disksrc->backingStore) { disksrc->backingStore = virStorageSourceNew(); + disksrc->backingStore->detected = true; + } /* we assume that FD-passed disks always exist */ if (virStorageSourceIsFD(disksrc)) diff --git a/src/storage_file/storage_source.c b/src/storage_file/storage_source.c index 47fc1edbd2..3c50239e29 100644 --- a/src/storage_file/storage_source.c +++ b/src/storage_file/storage_source.c @@ -1420,6 +1420,7 @@ virStorageSourceGetMetadataRecurse(virStorageSource *src, } else { /* add terminator */ src->backingStore = virStorageSourceNew(); + src->backingStore->detected = true; } return 0; -- 2.41.0

On a Friday in 2023, Peter Krempa wrote:
All backing chain members which were auto-added by image detection, including the terminating element, should have the 'detected' property set to true. This is needed to properly strip the detected elements in some cases, e.g. for the status XML where we could treat some images as manually terminated even when it was auto-detected.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_domain.c | 4 +++- src/storage_file/storage_source.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Sarah Connor <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Peter Krempa