[PATCH 0/2] qemuDomainCheckpointLoad: Two fixes

Peter Krempa (2): qemuDomainCheckpointLoad: Don't align disks when restoring config from disk qemuDomainCheckpointLoad: Remove stale comment src/qemu/qemu_driver.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) -- 2.29.2

The alignment step is not really necessary once we've done it already since we fully populate the definition. In case of checkpoints it was a relic necessary for populating the 'idx' to match checkpoint disk to definition disk, but that was already removed. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_driver.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7093fc619b..0e5d7423dc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -512,18 +512,11 @@ qemuDomainCheckpointLoad(virDomainObjPtr vm, continue; } - def = virDomainCheckpointDefParseString(xmlStr, - qemu_driver->xmlopt, - priv->qemuCaps, - flags); - if (!def || virDomainCheckpointAlignDisks(def) < 0) { - /* Nothing we can do here, skip this one */ - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to parse checkpoint XML from file '%s'"), - fullpath); - virObjectUnref(def); + if (!(def = virDomainCheckpointDefParseString(xmlStr, + qemu_driver->xmlopt, + priv->qemuCaps, + flags))) continue; - } chk = virDomainCheckpointAssignDef(vm->checkpoints, def); if (chk == NULL) -- 2.29.2

We decided to not do metadata-less checkpoints and checking whether the metadata is consistent is done once the data is actually needed. Remove the comment. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_driver.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0e5d7423dc..58c376fbe5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -533,13 +533,6 @@ qemuDomainCheckpointLoad(virDomainObjPtr vm, vm->def->name); virDomainCheckpointSetCurrent(vm->checkpoints, current); - /* Note that it is not practical to automatically construct - * checkpoints based solely on qcow2 bitmaps, since qemu does not - * track parent relations which we find important in our metadata. - * Perhaps we could double-check that our just-loaded checkpoint - * metadata is consistent with existing qcow2 bitmaps, but a user - * that changes things behind our backs deserves what happens. */ - virResetLastError(); ret = 0; -- 2.29.2

On a Tuesday in 2020, Peter Krempa wrote:
Peter Krempa (2): qemuDomainCheckpointLoad: Don't align disks when restoring config from disk qemuDomainCheckpointLoad: Remove stale comment
src/qemu/qemu_driver.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Peter Krempa