mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListSteal()
Reviewed-by: Laine Stump <laine@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
f1370f9ca6
commit
de80a10738
@ -822,7 +822,7 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr,
|
||||
|
||||
VIR_DEBUG("Removing PCI device %s from inactive list",
|
||||
virPCIDeviceGetName(pci));
|
||||
actual = virPCIDeviceListSteal(mgr->inactivePCIHostdevs, pci);
|
||||
actual = virPCIDeviceListSteal(mgr->inactivePCIHostdevs, virPCIDeviceGetAddress(pci));
|
||||
|
||||
VIR_DEBUG("Adding PCI device %s to active list",
|
||||
virPCIDeviceGetName(pci));
|
||||
@ -894,7 +894,8 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr,
|
||||
|
||||
VIR_DEBUG("Removing PCI device %s from active list",
|
||||
virPCIDeviceGetName(pci));
|
||||
if (!(actual = virPCIDeviceListSteal(mgr->activePCIHostdevs, pci)))
|
||||
if (!(actual = virPCIDeviceListSteal(mgr->activePCIHostdevs,
|
||||
virPCIDeviceGetAddress(pci))))
|
||||
continue;
|
||||
|
||||
VIR_DEBUG("Adding PCI device %s to inactive list",
|
||||
@ -997,7 +998,8 @@ virHostdevReAttachPCIDevicesImpl(virHostdevManagerPtr mgr,
|
||||
|
||||
VIR_DEBUG("Removing PCI device %s from active list",
|
||||
virPCIDeviceGetName(pci));
|
||||
actual = virPCIDeviceListSteal(mgr->activePCIHostdevs, pci);
|
||||
actual = virPCIDeviceListSteal(mgr->activePCIHostdevs,
|
||||
virPCIDeviceGetAddress(pci));
|
||||
|
||||
VIR_DEBUG("Adding PCI device %s to inactive list",
|
||||
virPCIDeviceGetName(pci));
|
||||
|
@ -1743,16 +1743,16 @@ virPCIDeviceListStealIndex(virPCIDeviceListPtr list,
|
||||
|
||||
virPCIDevicePtr
|
||||
virPCIDeviceListSteal(virPCIDeviceListPtr list,
|
||||
virPCIDevicePtr dev)
|
||||
virPCIDeviceAddressPtr devAddr)
|
||||
{
|
||||
return virPCIDeviceListStealIndex(list, virPCIDeviceListFindIndex(list, &dev->address));
|
||||
return virPCIDeviceListStealIndex(list, virPCIDeviceListFindIndex(list, devAddr));
|
||||
}
|
||||
|
||||
void
|
||||
virPCIDeviceListDel(virPCIDeviceListPtr list,
|
||||
virPCIDevicePtr dev)
|
||||
{
|
||||
virPCIDeviceFree(virPCIDeviceListSteal(list, dev));
|
||||
virPCIDeviceFree(virPCIDeviceListSteal(list, &dev->address));
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -166,7 +166,7 @@ virPCIDevicePtr virPCIDeviceListGet(virPCIDeviceListPtr list,
|
||||
int idx);
|
||||
size_t virPCIDeviceListCount(virPCIDeviceListPtr list);
|
||||
virPCIDevicePtr virPCIDeviceListSteal(virPCIDeviceListPtr list,
|
||||
virPCIDevicePtr dev);
|
||||
virPCIDeviceAddressPtr devAddr);
|
||||
virPCIDevicePtr virPCIDeviceListStealIndex(virPCIDeviceListPtr list,
|
||||
int idx);
|
||||
void virPCIDeviceListDel(virPCIDeviceListPtr list,
|
||||
|
Loading…
x
Reference in New Issue
Block a user