mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
conf: Move virDomainPCIAddressAsString() to util/virpci
It's a better fit than conf/domain_conf. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
e9e904b3b7
commit
b72183223f
@ -573,20 +573,6 @@ virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs,
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr)
|
||||
{
|
||||
char *str;
|
||||
|
||||
ignore_value(virAsprintf(&str, "%.4x:%.2x:%.2x.%.1x",
|
||||
addr->domain,
|
||||
addr->bus,
|
||||
addr->slot,
|
||||
addr->function));
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check if the PCI slot is used by another device.
|
||||
*/
|
||||
|
@ -124,9 +124,6 @@ struct _virDomainPCIAddressSet {
|
||||
typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet;
|
||||
typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr;
|
||||
|
||||
char *virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
virDomainPCIAddressSetPtr virDomainPCIAddressSetAlloc(unsigned int nbuses);
|
||||
|
||||
void virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs);
|
||||
|
@ -119,7 +119,6 @@ virPCIDeviceAddressParseXML;
|
||||
virDomainCCWAddressAssign;
|
||||
virDomainCCWAddressSetCreateFromDomain;
|
||||
virDomainCCWAddressSetFree;
|
||||
virDomainPCIAddressAsString;
|
||||
virDomainPCIAddressBusIsFullyReserved;
|
||||
virDomainPCIAddressBusSetModel;
|
||||
virDomainPCIAddressEnsureAddr;
|
||||
@ -2497,6 +2496,7 @@ virObjectUnref;
|
||||
|
||||
|
||||
# util/virpci.h
|
||||
virDomainPCIAddressAsString;
|
||||
virPCIDeviceAddressGetIOMMUGroupAddresses;
|
||||
virPCIDeviceAddressGetIOMMUGroupNum;
|
||||
virPCIDeviceAddressGetSysfsFile;
|
||||
|
@ -1684,6 +1684,19 @@ virPCIGetAddrString(unsigned int domain,
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr)
|
||||
{
|
||||
char *str;
|
||||
|
||||
ignore_value(virAsprintf(&str, "%.4x:%.2x:%.2x.%.1x",
|
||||
addr->domain,
|
||||
addr->bus,
|
||||
addr->slot,
|
||||
addr->function));
|
||||
return str;
|
||||
}
|
||||
|
||||
virPCIDevicePtr
|
||||
virPCIDeviceNew(unsigned int domain,
|
||||
unsigned int bus,
|
||||
|
@ -225,6 +225,9 @@ int virPCIGetAddrString(unsigned int domain,
|
||||
char **pciConfigAddr)
|
||||
ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
char *virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
int virPCIDeviceAddressParse(char *address, virPCIDeviceAddressPtr bdf);
|
||||
|
||||
int virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path,
|
||||
|
Loading…
Reference in New Issue
Block a user