mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 03:21:19 +00:00
qemuValidateDomainDeviceDefDiskFrontend: Aggregate disk iomode validation
Move the two checks under a common block. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
217e1527e9
commit
108676c225
@ -2861,12 +2861,28 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disk->iomode == VIR_DOMAIN_DISK_IO_NATIVE &&
|
switch (disk->iomode) {
|
||||||
disk->cachemode != VIR_DOMAIN_DISK_CACHE_DIRECTSYNC &&
|
case VIR_DOMAIN_DISK_IO_NATIVE:
|
||||||
disk->cachemode != VIR_DOMAIN_DISK_CACHE_DISABLE) {
|
if (disk->cachemode != VIR_DOMAIN_DISK_CACHE_DIRECTSYNC &&
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
disk->cachemode != VIR_DOMAIN_DISK_CACHE_DISABLE) {
|
||||||
_("io='native' needs either no disk cache or directsync cache mode"));
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
return -1;
|
_("io='native' needs either no disk cache or directsync cache mode"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIR_DOMAIN_DISK_IO_URING:
|
||||||
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AIO_IO_URING)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("io uring is not supported by this QEMU binary"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIR_DOMAIN_DISK_IO_THREADS:
|
||||||
|
case VIR_DOMAIN_DISK_IO_DEFAULT:
|
||||||
|
case VIR_DOMAIN_DISK_IO_LAST:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disk->serial &&
|
if (disk->serial &&
|
||||||
@ -2892,14 +2908,6 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disk->iomode == VIR_DOMAIN_DISK_IO_URING) {
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AIO_IO_URING)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("io uring is not supported by this QEMU binary"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disk->serial &&
|
if (disk->serial &&
|
||||||
qemuValidateDomainDeviceDefDiskSerial(disk->serial) < 0)
|
qemuValidateDomainDeviceDefDiskSerial(disk->serial) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user