]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Move some device_conf predicates
authorAndrea Bolognani <abologna@redhat.com>
Fri, 17 Aug 2018 13:35:19 +0000 (15:35 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 28 Aug 2018 09:08:28 +0000 (11:08 +0200)
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>
src/conf/device_conf.c
src/conf/device_conf.h
src/libvirt_private.syms

index d69f94fadf144f25fe7fee09198059e332ee9d66..7a8f84e036c18b5427c21088e3b269cabbafd88f 100644 (file)
@@ -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)
index 8c2bda2f4ff94e21ee97ea7ac276b0e004c03aaa..ff7d6c9d5fa9b5f7aecd9bdfe1e6b30e36180b82 100644 (file)
@@ -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);
index 47ea35f864cb0af1c6aa65a005c8cb0d0e6d08ba..954ab4b66ca2aa4318f30941c52b34d2aa897ab3 100644 (file)
@@ -93,12 +93,15 @@ virCPUModeTypeToString;
 
 
 # conf/device_conf.h
+virDeviceInfoPCIAddressIsPresent;
+virDeviceInfoPCIAddressIsWanted;
 virDomainDeviceInfoAddressIsEqual;
 virDomainDeviceInfoCopy;
 virInterfaceLinkFormat;
 virInterfaceLinkParseXML;
 virPCIDeviceAddressEqual;
 virPCIDeviceAddressFormat;
+virPCIDeviceAddressIsEmpty;
 virPCIDeviceAddressIsValid;
 virPCIDeviceAddressParseXML;