mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: snapshot: Check for block jobs individually
If any disk of a VM was involved in a (copy) block job we refused to do a snapshot. As not only copy jobs interlock snapshots and the interlocking is applicable to individual disks only we can make the check in a more individual fashion and interlock all block job types supported by libvirt. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1203628
This commit is contained in:
parent
15e61034a5
commit
c2a81eb7e1
@ -13926,6 +13926,14 @@ qemuDomainSnapshotPrepare(virConnectPtr conn,
|
||||
virDomainSnapshotDiskDefPtr disk = &def->disks[i];
|
||||
virDomainDiskDefPtr dom_disk = vm->def->disks[i];
|
||||
|
||||
if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE &&
|
||||
dom_disk->blockjob) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk '%s' has an active block job"),
|
||||
disk->name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
switch ((virDomainSnapshotLocation) disk->snapshot) {
|
||||
case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL:
|
||||
found_internal = true;
|
||||
@ -14572,11 +14580,6 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
||||
"%s", _("domain is marked for auto destroy"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (virDomainHasDiskMirror(vm)) {
|
||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, "%s",
|
||||
_("domain has active block job"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!vm->persistent && (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user