From 3ebf5484bce302c3eedb5b1edc5c65e212403f09 Mon Sep 17 00:00:00 2001 From: Shradha Shah Date: Thu, 16 Aug 2012 16:42:14 +0100 Subject: [PATCH] conf: add function virDevicePCIAddressEqual This function is needed by the network driver in a later commit. It 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(+) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index d558ea785..afd4eca5d 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 bbd5decba..264c8e0cd 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 c52273bab..7539edc7b 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; -- 2.39.5