mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
conf: Move some device_conf predicates
Turn virPCIDeviceAddressIsEmpty() virDeviceInfoPCIAddressIsWanted() virDeviceInfoPCIAddressIsPresent() from inline functions to regular functions. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
76151a53a1
commit
9ad119f4db
@ -191,6 +191,28 @@ int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr)
|
||||||
|
{
|
||||||
|
return !(addr->domain || addr->bus || addr->slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info)
|
||||||
|
{
|
||||||
|
return info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE ||
|
||||||
|
(info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
|
||||||
|
virPCIDeviceAddressIsEmpty(&info->addr.pci));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
virDeviceInfoPCIAddressIsPresent(const virDomainDeviceInfo *info)
|
||||||
|
{
|
||||||
|
return info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
|
||||||
|
!virPCIDeviceAddressIsEmpty(&info->addr.pci);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virPCIDeviceAddressParseXML(xmlNodePtr node,
|
virPCIDeviceAddressParseXML(xmlNodePtr node,
|
||||||
virPCIDeviceAddressPtr addr)
|
virPCIDeviceAddressPtr addr)
|
||||||
|
@ -188,27 +188,10 @@ bool virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a,
|
|||||||
|
|
||||||
int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr,
|
int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr,
|
||||||
bool report);
|
bool report);
|
||||||
|
bool virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr);
|
||||||
|
|
||||||
static inline bool
|
bool virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info);
|
||||||
virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr)
|
bool virDeviceInfoPCIAddressIsPresent(const virDomainDeviceInfo *info);
|
||||||
{
|
|
||||||
return !(addr->domain || addr->bus || addr->slot);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool
|
|
||||||
virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info)
|
|
||||||
{
|
|
||||||
return info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE ||
|
|
||||||
(info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
|
|
||||||
virPCIDeviceAddressIsEmpty(&info->addr.pci));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool
|
|
||||||
virDeviceInfoPCIAddressIsPresent(const virDomainDeviceInfo *info)
|
|
||||||
{
|
|
||||||
return info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
|
|
||||||
!virPCIDeviceAddressIsEmpty(&info->addr.pci);
|
|
||||||
}
|
|
||||||
|
|
||||||
int virPCIDeviceAddressParseXML(xmlNodePtr node,
|
int virPCIDeviceAddressParseXML(xmlNodePtr node,
|
||||||
virPCIDeviceAddressPtr addr);
|
virPCIDeviceAddressPtr addr);
|
||||||
|
@ -93,12 +93,15 @@ virCPUModeTypeToString;
|
|||||||
|
|
||||||
|
|
||||||
# conf/device_conf.h
|
# conf/device_conf.h
|
||||||
|
virDeviceInfoPCIAddressIsPresent;
|
||||||
|
virDeviceInfoPCIAddressIsWanted;
|
||||||
virDomainDeviceInfoAddressIsEqual;
|
virDomainDeviceInfoAddressIsEqual;
|
||||||
virDomainDeviceInfoCopy;
|
virDomainDeviceInfoCopy;
|
||||||
virInterfaceLinkFormat;
|
virInterfaceLinkFormat;
|
||||||
virInterfaceLinkParseXML;
|
virInterfaceLinkParseXML;
|
||||||
virPCIDeviceAddressEqual;
|
virPCIDeviceAddressEqual;
|
||||||
virPCIDeviceAddressFormat;
|
virPCIDeviceAddressFormat;
|
||||||
|
virPCIDeviceAddressIsEmpty;
|
||||||
virPCIDeviceAddressIsValid;
|
virPCIDeviceAddressIsValid;
|
||||||
virPCIDeviceAddressParseXML;
|
virPCIDeviceAddressParseXML;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user