[PATCH 5/7] Add function virDevicePCIAddressEqual

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This function is needed by the network driver in a later commit.
This function is useful in functions like networkNotifyActualDevice
and networkReleaseActualDevice
---
 src/conf/device_conf.c   |   16 ++++++++++++++++
 src/conf/device_conf.h   |    3 +++
 src/libvirt_private.syms |    1 +
 3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c
index ca600c5..8edcc0a 100644
--- a/src/conf/device_conf.c
+++ b/src/conf/device_conf.c
@@ -129,3 +129,19 @@ virDevicePCIAddressFormat(virBufferPtr buf,
                       addr.function);
     return 0;
 }
+
+int
+virDevicePCIAddressEqual(virDevicePCIAddress addr1,
+                         virDevicePCIAddress addr2)
+{
+    int ret = -1;
+
+    if (addr1.domain == addr2.domain &&
+        addr1.bus == addr2.bus &&
+        addr1.slot == addr2.slot &&
+        addr1.function == addr2.function) {
+        ret = 0;
+    }
+
+    return ret;
+}
diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h
index c679bce..7c4d356 100644
--- a/src/conf/device_conf.h
+++ b/src/conf/device_conf.h
@@ -59,6 +59,9 @@ int virDevicePCIAddressFormat(virBufferPtr buf,
                               virDevicePCIAddress addr,
                               bool includeTypeInAddr);
 
+int virDevicePCIAddressEqual(virDevicePCIAddress addr1,
+                             virDevicePCIAddress addr2);
+
 
 VIR_ENUM_DECL(virDeviceAddressPciMulti)
 
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 1f32f8e..063d0bc 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -224,6 +224,7 @@ virDeviceAddressPciMultiTypeToString;
 virDevicePCIAddressIsValid;
 virDevicePCIAddressParseXML;
 virDevicePCIAddressFormat;
+virDevicePCIAddressEqual;
 
 # dnsmasq.h
 dnsmasqAddDhcpHost;
-- 
1.7.4.4


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]