mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: More usage of qemuDomainDiskBlockJobIsActive
qemuDomainDiskBlockJobIsActive already checks if a disk has a blockjob, and if so, raises an error
This commit is contained in:
parent
b14b37b5ed
commit
b732704f49
@ -13712,15 +13712,10 @@ qemuDomainSnapshotPrepare(virConnectPtr conn,
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
virDomainSnapshotDiskDefPtr disk = &def->disks[i];
|
||||
virDomainDiskDefPtr dom_disk = vm->def->disks[i];
|
||||
qemuDomainDiskPrivatePtr dom_diskPriv = QEMU_DOMAIN_DISK_PRIVATE(dom_disk);
|
||||
|
||||
if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE &&
|
||||
dom_diskPriv->blockjob) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk '%s' has an active block job"),
|
||||
disk->name);
|
||||
qemuDomainDiskBlockJobIsActive(dom_disk))
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
switch ((virDomainSnapshotLocation) disk->snapshot) {
|
||||
case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL:
|
||||
|
@ -3444,12 +3444,8 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
|
||||
int ret = -1;
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
|
||||
if (detach->mirror) {
|
||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
|
||||
_("disk '%s' is in an active block job"),
|
||||
detach->dst);
|
||||
if (qemuDomainDiskBlockJobIsActive(detach))
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user