virDomainPCIControllerOpts: Change type of modelName to virDomainControllerPCIModelName

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-23 12:37:34 +02:00 committed by Ján Tomko
parent 8395c909a6
commit 376bb1ebb3
3 changed files with 11 additions and 9 deletions

View File

@ -9722,13 +9722,15 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt,
/* Other controller models don't require extra checks */
break;
}
if (modelName &&
(def->opts.pciopts.modelName
= virDomainControllerPCIModelNameTypeFromString(modelName)) <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unknown PCI controller model name '%s'"),
modelName);
return NULL;
if (modelName) {
int value;
if ((value = virDomainControllerPCIModelNameTypeFromString(modelName)) <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unknown PCI controller model name '%s'"),
modelName);
return NULL;
}
def->opts.pciopts.modelName = value;
}
if (chassisNr) {
if (virStrToLong_i(chassisNr, NULL, 0,

View File

@ -724,7 +724,7 @@ struct _virDomainPCIControllerOpts {
* <model name='ioh3420''/>
* ...
*/
int modelName; /* the exact name of the device in hypervisor */
virDomainControllerPCIModelName modelName;
/* the following items are attributes of the "target" subelement
* of controller type='pci'. They are bits of configuration that

View File

@ -2456,7 +2456,7 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont,
virDomainDef *def,
virQEMUCaps *qemuCaps)
{
int *modelName = &cont->opts.pciopts.modelName;
virDomainControllerPCIModelName *modelName = &cont->opts.pciopts.modelName;
/* make sure it's not already set */
if (*modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE)