On Mon, Sep 18, 2023 at 15:29:22 +0200, Pavel Hrdina wrote:
When called from snapshot code we will need to pass snapshot object
in
order to make internal snapshots work correctly.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_process.c | 9 ++++++++-
src/qemu/qemu_process.h | 1 +
src/qemu/qemu_saveimage.c | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d414a40fd5..c8430bf7b7 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8164,6 +8164,7 @@ qemuProcessStart(virConnectPtr conn,
* @vm: domain object
* @fd: FD pointer of memory state file
* @path: path to memory state file
+ * @snapshot: internal snapshot to load when starting QEMU process or NULL
* @data: data from memory state file
* @asyncJob: type of asynchronous job
* @start_flags: flags to start QEMU process with
@@ -8173,6 +8174,11 @@ qemuProcessStart(virConnectPtr conn,
* Start VM with existing memory state. Make sure that the stored memory state
* is correctly decompressed so it can be loaded by QEMU process.
*
+ * When reverting to internal snapshot callers needs to pass @snapshot as well
+ * correctly start QEMU process.
It doesn't mention that callers must not pass the other state-related
parameters as both methods can't be used at once.
+ *
+ * When restoring VM from saved image @snapshot needs to be NULL.
This is only an implication (one way) that says that with a saveimage
@snapshot must be null, but not that it's also the other way around.