mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-01 23:52:37 +00:00
qemuProcessStartWithMemoryState: add snapshot argument
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@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
6a88060d32
commit
8a88d3e586
|
@ -8099,6 +8099,7 @@ qemuProcessStart(virConnectPtr conn,
|
||||||
* @vm: domain object
|
* @vm: domain object
|
||||||
* @fd: FD pointer of memory state file
|
* @fd: FD pointer of memory state file
|
||||||
* @path: path to 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
|
* @data: data from memory state file
|
||||||
* @asyncJob: type of asynchronous job
|
* @asyncJob: type of asynchronous job
|
||||||
* @start_flags: flags to start QEMU process with
|
* @start_flags: flags to start QEMU process with
|
||||||
|
@ -8108,6 +8109,11 @@ qemuProcessStart(virConnectPtr conn,
|
||||||
* Start VM with existing memory state. Make sure that the stored memory state
|
* Start VM with existing memory state. Make sure that the stored memory state
|
||||||
* is correctly decompressed so it can be loaded by QEMU process.
|
* is correctly decompressed so it can be loaded by QEMU process.
|
||||||
*
|
*
|
||||||
|
* When reverting to internal snapshot caller needs to pass @snapshot as well
|
||||||
|
* to correctly start QEMU process.
|
||||||
|
*
|
||||||
|
* When restoring VM from saved image @snapshot needs to be NULL.
|
||||||
|
*
|
||||||
* For audit purposes the expected @reason is one of `restored` or `from-snapshot`.
|
* For audit purposes the expected @reason is one of `restored` or `from-snapshot`.
|
||||||
*
|
*
|
||||||
* Returns 0 on success, -1 on error.
|
* Returns 0 on success, -1 on error.
|
||||||
|
@ -8118,6 +8124,7 @@ qemuProcessStartWithMemoryState(virConnectPtr conn,
|
||||||
virDomainObj *vm,
|
virDomainObj *vm,
|
||||||
int *fd,
|
int *fd,
|
||||||
const char *path,
|
const char *path,
|
||||||
|
virDomainMomentObj *snapshot,
|
||||||
virQEMUSaveData *data,
|
virQEMUSaveData *data,
|
||||||
virDomainAsyncJob asyncJob,
|
virDomainAsyncJob asyncJob,
|
||||||
unsigned int start_flags,
|
unsigned int start_flags,
|
||||||
|
@ -8149,7 +8156,7 @@ qemuProcessStartWithMemoryState(virConnectPtr conn,
|
||||||
priv->disableSlirp = true;
|
priv->disableSlirp = true;
|
||||||
|
|
||||||
if (qemuProcessStart(conn, driver, vm, cookie ? cookie->cpu : NULL,
|
if (qemuProcessStart(conn, driver, vm, cookie ? cookie->cpu : NULL,
|
||||||
asyncJob, "stdio", *fd, path, NULL,
|
asyncJob, "stdio", *fd, path, snapshot,
|
||||||
VIR_NETDEV_VPORT_PROFILE_OP_RESTORE,
|
VIR_NETDEV_VPORT_PROFILE_OP_RESTORE,
|
||||||
start_flags) == 0)
|
start_flags) == 0)
|
||||||
*started = true;
|
*started = true;
|
||||||
|
|
|
@ -96,6 +96,7 @@ int qemuProcessStartWithMemoryState(virConnectPtr conn,
|
||||||
virDomainObj *vm,
|
virDomainObj *vm,
|
||||||
int *fd,
|
int *fd,
|
||||||
const char *path,
|
const char *path,
|
||||||
|
virDomainMomentObj *snapshot,
|
||||||
virQEMUSaveData *data,
|
virQEMUSaveData *data,
|
||||||
virDomainAsyncJob asyncJob,
|
virDomainAsyncJob asyncJob,
|
||||||
unsigned int start_flags,
|
unsigned int start_flags,
|
||||||
|
|
|
@ -698,7 +698,7 @@ qemuSaveImageStartVM(virConnectPtr conn,
|
||||||
if (reset_nvram)
|
if (reset_nvram)
|
||||||
start_flags |= VIR_QEMU_PROCESS_START_RESET_NVRAM;
|
start_flags |= VIR_QEMU_PROCESS_START_RESET_NVRAM;
|
||||||
|
|
||||||
if (qemuProcessStartWithMemoryState(conn, driver, vm, fd, path, data,
|
if (qemuProcessStartWithMemoryState(conn, driver, vm, fd, path, NULL, data,
|
||||||
asyncJob, start_flags, "restored",
|
asyncJob, start_flags, "restored",
|
||||||
&started) < 0) {
|
&started) < 0) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user