diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index d558ea785f4f2bc2cb394a7389ccba6ff479f93f..afd4eca5d9d02ebe85f7ddbc0e50edc461a3ebfc 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 bbd5decba42388bb48e0d3a29d345a7fb1259c8c..264c8e0cd66af77fb98e0adb25a44ed1a6fb3421 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 c52273bab0de6e358e5a01987c48c0d978367717..7539edc7b0825e205d783048bb6011b252c09033 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -221,6 +221,7 @@ virStreamClass; # device_conf.h virDeviceAddressPciMultiTypeFromString; virDeviceAddressPciMultiTypeToString; +virDevicePCIAddressEqual; virDevicePCIAddressFormat; virDevicePCIAddressIsValid; virDevicePCIAddressParseXML;