mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
qemu: validate: Move validation of device rom
Move the validation from 'qemuBuildRomStr' into the function which validates device info. It was originally named 'qemuValidateDomainDeviceDefAddress' but this commit renames it to 'qemuValidateDomainDeviceDefInfo'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
98a574ca0d
commit
24be92b8e3
@ -1055,12 +1055,6 @@ qemuBuildRomStr(virBuffer *buf,
|
||||
virDomainDeviceInfo *info)
|
||||
{
|
||||
if (info->romenabled || info->rombar || info->romfile) {
|
||||
if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("ROM tuning is only supported for PCI devices"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Passing an empty romfile= tells QEMU to disable ROM entirely for
|
||||
* this device, and makes other settings irrelevant */
|
||||
if (info->romenabled == VIR_TRISTATE_BOOL_NO) {
|
||||
|
@ -1403,6 +1403,14 @@ qemuValidateDomainDeviceInfo(const virDomainDeviceDef *dev,
|
||||
}
|
||||
}
|
||||
|
||||
if (info->romenabled || info->rombar || info->romfile) {
|
||||
if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("ROM tuning is only supported for PCI devices"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user