* @data: data from memory state file
* @asyncJob: type of asynchronous job
* @start_flags: flags to start QEMU process with
+ * @reason: audit log reason
* @started: boolean to store if QEMU process was started
*
* Start VM with existing memory state. Make sure that the stored memory state
* is correctly decompressed so it can be loaded by QEMU process.
*
+ * For audit purposes the expected @reason is one of `restored` or `from-snapshot`.
+ *
* Returns 0 on success, -1 on error.
*/
int
virQEMUSaveData *data,
virDomainAsyncJob asyncJob,
unsigned int start_flags,
+ const char *reason,
bool *started)
{
qemuDomainObjPrivate *priv = vm->privateData;
rc = qemuSaveImageDecompressionStop(cmd, fd, &intermediatefd, errbuf, *started, path);
- virDomainAuditStart(vm, "restored", *started);
+ virDomainAuditStart(vm, reason, *started);
if (!*started || rc < 0)
return -1;
virQEMUSaveData *data,
virDomainAsyncJob asyncJob,
unsigned int start_flags,
+ const char *reason,
bool *started);
int qemuProcessCreatePretendCmdPrepare(virQEMUDriver *driver,
start_flags |= VIR_QEMU_PROCESS_START_RESET_NVRAM;
if (qemuProcessStartWithMemoryState(conn, driver, vm, fd, path, data,
- asyncJob, start_flags, &started) < 0) {
+ asyncJob, start_flags, "restored",
+ &started) < 0) {
goto cleanup;
}