On Fri, Sep 01, 2023 at 10:32:15 +0200, Pavel Hrdina wrote:
Original code assumed that the memory state file is only migration
stream but it has additional metadata stored by libvirt. To correctly
load the memory state file we need to reuse code that is used when
restoring domain from saved image.
This duplicates some necessary parts of qemuSaveImageStartVM() because
the external snapshot memory state is done by qemuSaveImageCreate().
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 115 +++++++++++++++++++++++++++++++++------
1 file changed, 97 insertions(+), 18 deletions(-)
[...]
/* No cookie means libvirt which saved the domain was too old
to
* mess up the CPU definitions.
*/
@@ -2307,17 +2355,48 @@ qemuSnapshotRevertActive(virDomainObj *vm,
rc = qemuProcessStart(snapshot->domain->conn, driver, vm,
cookie ? cookie->cpu : NULL,
As noted in review of v1, we ought to use the cookie from the save image
or at least validate that this one is correct.