mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
util: rename virPCIDeviceGetDriverPathAndName
Instead, call it virPCIDeviceGetCurrentDriverPathAndName() to avoid confusion with the device name that is stored in the virPCIDevice object - that one is not necessarily the name of the current driver for the device, but could instead be the driver that we want to be bound to the device in the future. Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
1bb9617971
commit
222b66974e
@ -765,9 +765,10 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
|
||||
* information about active / inactive device across
|
||||
* daemon restarts has been implemented */
|
||||
|
||||
if (virPCIDeviceGetDriverPathAndName(pci,
|
||||
&driverPath, &driverName) < 0)
|
||||
if (virPCIDeviceGetCurrentDriverPathAndName(pci, &driverPath,
|
||||
&driverName) < 0) {
|
||||
goto reattachdevs;
|
||||
}
|
||||
|
||||
stub = virPCIStubDriverTypeFromString(driverName);
|
||||
|
||||
@ -2294,7 +2295,7 @@ virHostdevPrepareOneNVMeDevice(virHostdevManager *hostdev_mgr,
|
||||
g_autofree char *drvName = NULL;
|
||||
int stub = VIR_PCI_STUB_DRIVER_NONE;
|
||||
|
||||
if (virPCIDeviceGetDriverPathAndName(pci, &drvPath, &drvName) < 0)
|
||||
if (virPCIDeviceGetCurrentDriverPathAndName(pci, &drvPath, &drvName) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (drvName)
|
||||
|
@ -3074,7 +3074,7 @@ virPCIDeviceFileIterate;
|
||||
virPCIDeviceFree;
|
||||
virPCIDeviceGetAddress;
|
||||
virPCIDeviceGetConfigPath;
|
||||
virPCIDeviceGetDriverPathAndName;
|
||||
virPCIDeviceGetCurrentDriverPathAndName;
|
||||
virPCIDeviceGetIOMMUGroupDev;
|
||||
virPCIDeviceGetIOMMUGroupList;
|
||||
virPCIDeviceGetLinkCapSta;
|
||||
|
@ -228,7 +228,7 @@ virPCIFile(const char *device, const char *file)
|
||||
}
|
||||
|
||||
|
||||
/* virPCIDeviceGetDriverPathAndName - put the path to the driver
|
||||
/* virPCIDeviceGetCurrentDriverPathAndName - put the path to the driver
|
||||
* directory of the driver in use for this device in @path and the
|
||||
* name of the driver in @name. Both could be NULL if it's not bound
|
||||
* to any driver.
|
||||
@ -236,7 +236,9 @@ virPCIFile(const char *device, const char *file)
|
||||
* Return 0 for success, -1 for error.
|
||||
*/
|
||||
int
|
||||
virPCIDeviceGetDriverPathAndName(virPCIDevice *dev, char **path, char **name)
|
||||
virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
|
||||
char **path,
|
||||
char **name)
|
||||
{
|
||||
int ret = -1;
|
||||
g_autofree char *drvlink = NULL;
|
||||
@ -1032,7 +1034,7 @@ virPCIDeviceReset(virPCIDevice *dev,
|
||||
* reset it whenever appropriate, so doing it ourselves would just
|
||||
* be redundant.
|
||||
*/
|
||||
if (virPCIDeviceGetDriverPathAndName(dev, &drvPath, &drvName) < 0)
|
||||
if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvPath, &drvName) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virPCIStubDriverTypeFromString(drvName) == VIR_PCI_STUB_DRIVER_VFIO) {
|
||||
@ -1137,7 +1139,7 @@ virPCIDeviceUnbind(virPCIDevice *dev)
|
||||
g_autofree char *drvpath = NULL;
|
||||
g_autofree char *driver = NULL;
|
||||
|
||||
if (virPCIDeviceGetDriverPathAndName(dev, &drvpath, &driver) < 0)
|
||||
if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvpath, &driver) < 0)
|
||||
return -1;
|
||||
|
||||
if (!driver)
|
||||
|
@ -280,9 +280,9 @@ virPCIVPDResource * virPCIDeviceGetVPD(virPCIDevice *dev);
|
||||
|
||||
int virPCIDeviceUnbind(virPCIDevice *dev);
|
||||
int virPCIDeviceRebind(virPCIDevice *dev);
|
||||
int virPCIDeviceGetDriverPathAndName(virPCIDevice *dev,
|
||||
char **path,
|
||||
char **name);
|
||||
int virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
|
||||
char **path,
|
||||
char **name);
|
||||
|
||||
int virPCIDeviceIsPCIExpress(virPCIDevice *dev);
|
||||
int virPCIDeviceHasPCIExpressLink(virPCIDevice *dev);
|
||||
|
@ -37,7 +37,7 @@ testVirPCIDeviceCheckDriver(virPCIDevice *dev, const char *expected)
|
||||
g_autofree char *path = NULL;
|
||||
g_autofree char *driver = NULL;
|
||||
|
||||
if (virPCIDeviceGetDriverPathAndName(dev, &path, &driver) < 0)
|
||||
if (virPCIDeviceGetCurrentDriverPathAndName(dev, &path, &driver) < 0)
|
||||
return -1;
|
||||
|
||||
if (STRNEQ_NULLABLE(driver, expected)) {
|
||||
|
Loading…
Reference in New Issue
Block a user