mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
conf: Use virTristateXXX in virPCIDeviceAddress
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
975e2cb39d
commit
876f994db1
@ -246,13 +246,15 @@ virPCIDeviceAddressParseXML(xmlNodePtr node,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (multi &&
|
||||
((addr->multi = virTristateSwitchTypeFromString(multi)) <= 0)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unknown value '%s' for <address> 'multifunction' attribute"),
|
||||
multi);
|
||||
return -1;
|
||||
|
||||
if (multi) {
|
||||
int value;
|
||||
if ((value = virTristateSwitchTypeFromString(multi)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unknown value '%s' for <address> 'multifunction' attribute"),
|
||||
multi);
|
||||
return -1;
|
||||
}
|
||||
addr->multi = value;
|
||||
}
|
||||
if (!virPCIDeviceAddressIsEmpty(addr) && !virPCIDeviceAddressIsValid(addr, true))
|
||||
return -1;
|
||||
|
@ -61,7 +61,7 @@ struct _virPCIDeviceAddress {
|
||||
unsigned int bus;
|
||||
unsigned int slot;
|
||||
unsigned int function;
|
||||
int multi; /* virTristateSwitch */
|
||||
virTristateSwitch multi;
|
||||
int extFlags; /* enum virPCIDeviceAddressExtensionFlags */
|
||||
virZPCIDeviceAddress zpci;
|
||||
/* Don't forget to update virPCIDeviceAddressCopy if needed. */
|
||||
|
Loading…
Reference in New Issue
Block a user