mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
qemu: Use switch for qemuCheckIOThreads
Rather than an if statement, use a switch. The switch will also catch the illegal usage of 'iothread' with some other kind of unsupported bus configuration.
This commit is contained in:
parent
e0d0e53086
commit
ade5dae282
@ -1468,12 +1468,29 @@ qemuCheckIOThreads(const virDomainDef *def,
|
|||||||
virDomainDiskDefPtr disk)
|
virDomainDiskDefPtr disk)
|
||||||
{
|
{
|
||||||
/* Right "type" of disk" */
|
/* Right "type" of disk" */
|
||||||
if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO ||
|
switch ((virDomainDiskBus)disk->bus) {
|
||||||
(disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
|
case VIR_DOMAIN_DISK_BUS_VIRTIO:
|
||||||
disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
|
if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
|
||||||
_("IOThreads only available for virtio pci and "
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
"virtio ccw disk"));
|
_("IOThreads only available for virtio pci and "
|
||||||
|
"virtio ccw disk"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIR_DOMAIN_DISK_BUS_IDE:
|
||||||
|
case VIR_DOMAIN_DISK_BUS_FDC:
|
||||||
|
case VIR_DOMAIN_DISK_BUS_SCSI:
|
||||||
|
case VIR_DOMAIN_DISK_BUS_XEN:
|
||||||
|
case VIR_DOMAIN_DISK_BUS_USB:
|
||||||
|
case VIR_DOMAIN_DISK_BUS_UML:
|
||||||
|
case VIR_DOMAIN_DISK_BUS_SATA:
|
||||||
|
case VIR_DOMAIN_DISK_BUS_SD:
|
||||||
|
case VIR_DOMAIN_DISK_BUS_LAST:
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("IOThreads not available for bus %s target %s"),
|
||||||
|
virDomainDiskBusTypeToString(disk->bus), disk->dst);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user