# util/virpci.h
virPCIDeviceAddressAsString;
+virPCIDeviceAddressCopy;
virPCIDeviceAddressEqual;
virPCIDeviceAddressFree;
virPCIDeviceAddressGetIOMMUGroupAddresses;
return false;
}
+/**
+ * virPCIDeviceAddressCopy:
+ * @dst: where to store address
+ * @src: source address to copy
+ *
+ * Creates a deep copy of given @src address and stores it into
+ * @dst which has to be pre-allocated by caller.
+ */
+void virPCIDeviceAddressCopy(virPCIDeviceAddressPtr dst,
+ const virPCIDeviceAddress *src)
+{
+ memcpy(dst, src, sizeof(*src));
+}
+
char *
virPCIDeviceAddressAsString(const virPCIDeviceAddress *addr)
{
struct _virZPCIDeviceAddress {
unsigned int uid; /* exempt from syntax-check */
unsigned int fid;
+ /* Don't forget to update virPCIDeviceAddressCopy if needed. */
};
#define VIR_PCI_DEVICE_ADDRESS_FMT "%04x:%02x:%02x.%d"
int multi; /* virTristateSwitch */
int extFlags; /* enum virPCIDeviceAddressExtensionFlags */
virZPCIDeviceAddress zpci;
+ /* Don't forget to update virPCIDeviceAddressCopy if needed. */
};
typedef enum {
bool virPCIDeviceAddressEqual(const virPCIDeviceAddress *addr1,
const virPCIDeviceAddress *addr2);
+void virPCIDeviceAddressCopy(virPCIDeviceAddressPtr dst,
+ const virPCIDeviceAddress *src);
char *virPCIDeviceAddressAsString(const virPCIDeviceAddress *addr)
ATTRIBUTE_NONNULL(1);