return ret;
}
-/* this internal function expects the driver lock to already be held on entry */
+/* This internal function expects the driver lock to already be held on
+ * entry and the vm must be active.
+ */
static int qemudDomainSaveFlag(struct qemud_driver *driver, virDomainPtr dom,
virDomainObjPtr vm, const char *path,
int compressed)
if (qemuDomainObjBeginJobWithDriver(driver, vm) < 0)
goto cleanup;
- if (!virDomainObjIsActive(vm)) {
- qemuReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domain is not running"));
- goto endjob;
- }
-
priv->jobActive = QEMU_JOB_SAVE;
memset(&priv->jobInfo, 0, sizeof(priv->jobInfo));
goto cleanup;
}
+ if (!virDomainObjIsActive(vm)) {
+ qemuReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
+ goto cleanup;
+ }
+
ret = qemudDomainSaveFlag(driver, dom, vm, path, compressed);
cleanup: