mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user