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
This commit is contained in:
Shradha Shah 2012-08-16 16:42:14 +01:00 committed by Laine Stump
parent 2b51a63bab
commit 3ebf5484bc
3 changed files with 20 additions and 0 deletions

View File

@ -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;
}

View File

@ -59,6 +59,9 @@ int virDevicePCIAddressFormat(virBufferPtr buf,
virDevicePCIAddress addr,
bool includeTypeInAddr);
int virDevicePCIAddressEqual(virDevicePCIAddress addr1,
virDevicePCIAddress addr2);
VIR_ENUM_DECL(virDeviceAddressPciMulti)

View File

@ -221,6 +221,7 @@ virStreamClass;
# device_conf.h
virDeviceAddressPciMultiTypeFromString;
virDeviceAddressPciMultiTypeToString;
virDevicePCIAddressEqual;
virDevicePCIAddressFormat;
virDevicePCIAddressIsValid;
virDevicePCIAddressParseXML;