提交 9ad119f4 编写于 作者: A Andrea Bolognani

conf: Move some device_conf predicates

Turn

  virPCIDeviceAddressIsEmpty()
  virDeviceInfoPCIAddressIsWanted()
  virDeviceInfoPCIAddressIsPresent()

from inline functions to regular functions.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 76151a53
......@@ -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
virPCIDeviceAddressParseXML(xmlNodePtr node,
virPCIDeviceAddressPtr addr)
......
......@@ -188,27 +188,10 @@ bool virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a,
int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr,
bool report);
bool virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr);
static inline bool
virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr)
{
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);
}
bool virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info);
bool virDeviceInfoPCIAddressIsPresent(const virDomainDeviceInfo *info);
int virPCIDeviceAddressParseXML(xmlNodePtr node,
virPCIDeviceAddressPtr addr);
......
......@@ -93,12 +93,15 @@ virCPUModeTypeToString;
# conf/device_conf.h
virDeviceInfoPCIAddressIsPresent;
virDeviceInfoPCIAddressIsWanted;
virDomainDeviceInfoAddressIsEqual;
virDomainDeviceInfoCopy;
virInterfaceLinkFormat;
virInterfaceLinkParseXML;
virPCIDeviceAddressEqual;
virPCIDeviceAddressFormat;
virPCIDeviceAddressIsEmpty;
virPCIDeviceAddressIsValid;
virPCIDeviceAddressParseXML;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册