mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
qemuDomainDiskControllerIsBusy: Optimize checking for SCSI hostdevs
Iterate through hostdevs only when the controller type is VIR_DOMAIN_CONTROLLER_TYPE_SCSI. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
022f4d431b
commit
279ba2d1cc
@ -5373,13 +5373,15 @@ qemuDomainDiskControllerIsBusy(virDomainObjPtr vm,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < vm->def->nhostdevs; i++) {
|
if (detach->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
|
||||||
hostdev = vm->def->hostdevs[i];
|
for (i = 0; i < vm->def->nhostdevs; i++) {
|
||||||
if (!virHostdevIsSCSIDevice(hostdev) ||
|
hostdev = vm->def->hostdevs[i];
|
||||||
detach->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI)
|
if (!virHostdevIsSCSIDevice(hostdev))
|
||||||
continue;
|
continue;
|
||||||
if (hostdev->info->addr.drive.controller == detach->idx)
|
|
||||||
return true;
|
if (hostdev->info->addr.drive.controller == detach->idx)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user