mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: Create new qemuDomainDeviceDefValidateControllerPCI()
The existing function is renamed and called from the new one, so that even while we're in the process of implementing new checks all the existing ones will be performed. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Laine Stump <laine@laine.org>
This commit is contained in:
parent
90d7262552
commit
e43103cbd0
@ -4268,9 +4268,9 @@ qemuDomainDeviceDefValidateControllerSCSI(const virDomainControllerDef *controll
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *controller,
|
||||
const virDomainDef *def,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
qemuDomainDeviceDefValidateControllerPCIOld(const virDomainControllerDef *controller,
|
||||
const virDomainDef *def,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
virDomainControllerModelPCI model = controller->model;
|
||||
const virDomainPCIControllerOpts *pciopts;
|
||||
@ -4547,6 +4547,29 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *controlle
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *cont,
|
||||
const virDomainDef *def,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
|
||||
{
|
||||
const virDomainPCIControllerOpts *pciopts = &cont->opts.pciopts;
|
||||
const char *model = virDomainControllerModelPCITypeToString(cont->model);
|
||||
const char *modelName = virDomainControllerPCIModelNameTypeToString(pciopts->modelName);
|
||||
|
||||
if (!model) {
|
||||
virReportEnumRangeError(virDomainControllerModelPCI, cont->model);
|
||||
return -1;
|
||||
}
|
||||
if (!modelName) {
|
||||
virReportEnumRangeError(virDomainControllerPCIModelName, pciopts->modelName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return qemuDomainDeviceDefValidateControllerPCIOld(cont, def, qemuCaps);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainDeviceDefValidateControllerSATA(const virDomainControllerDef *controller,
|
||||
const virDomainDef *def,
|
||||
|
Loading…
x
Reference in New Issue
Block a user