1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-20 18:03:50 +03:00

qemu: reuse qemuMigrationIsAllowed when doing save and managedsave

Save and managedsave both use migration to file. This patch reuses
qemuMigrationIsAllowed to check if the migration could happen before
trying.
This commit is contained in:
Peter Krempa 2012-12-07 12:12:56 +01:00
parent 98e92ba83b
commit 08379dbd45

View File

@ -3006,16 +3006,8 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
virDomainEventPtr event = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
if (qemuProcessAutoDestroyActive(driver, vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is marked for auto destroy"));
if (!qemuMigrationIsAllowed(driver, vm, vm->def, false))
goto cleanup;
}
if (virDomainHasDiskMirror(vm)) {
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, "%s",
_("domain has active block copy job"));
goto cleanup;
}
if (qemuDomainObjBeginAsyncJobWithDriver(driver, vm,
QEMU_ASYNC_JOB_SAVE) < 0)