1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-25 10:03:49 +03:00

pci: Phase out virPCIDeviceReattachInit()

The name is confusing, and there are just two uses: one is a test case,
and the other will be removed as part of an upcoming refactoring of
the hostdev code.
This commit is contained in:
Andrea Bolognani 2016-01-19 15:58:31 +01:00
parent d773b57d22
commit 771eaeb2b3
5 changed files with 7 additions and 12 deletions

View File

@ -1993,7 +1993,6 @@ virPCIDeviceListSteal;
virPCIDeviceListStealIndex; virPCIDeviceListStealIndex;
virPCIDeviceNew; virPCIDeviceNew;
virPCIDeviceReattach; virPCIDeviceReattach;
virPCIDeviceReattachInit;
virPCIDeviceReset; virPCIDeviceReset;
virPCIDeviceSetManaged; virPCIDeviceSetManaged;
virPCIDeviceSetRemoveSlot; virPCIDeviceSetRemoveSlot;

View File

@ -1619,7 +1619,9 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr,
if (virHostdevIsPCINodeDeviceUsed(virPCIDeviceGetAddress(pci), &data)) if (virHostdevIsPCINodeDeviceUsed(virPCIDeviceGetAddress(pci), &data))
goto out; goto out;
virPCIDeviceReattachInit(pci); virPCIDeviceSetUnbindFromStub(pci, true);
virPCIDeviceSetRemoveSlot(pci, true);
virPCIDeviceSetReprobe(pci, true);
if (virPCIDeviceReattach(pci, hostdev_mgr->activePCIHostdevs, if (virPCIDeviceReattach(pci, hostdev_mgr->activePCIHostdevs,
hostdev_mgr->inactivePCIHostdevs) < 0) hostdev_mgr->inactivePCIHostdevs) < 0)

View File

@ -1771,14 +1771,6 @@ virPCIDeviceGetUsedBy(virPCIDevicePtr dev,
*dom_name = dev->used_by_domname; *dom_name = dev->used_by_domname;
} }
void virPCIDeviceReattachInit(virPCIDevicePtr pci)
{
pci->unbind_from_stub = true;
pci->remove_slot = true;
pci->reprobe = true;
}
virPCIDeviceListPtr virPCIDeviceListPtr
virPCIDeviceListNew(void) virPCIDeviceListNew(void)
{ {

View File

@ -119,7 +119,6 @@ void virPCIDeviceSetRemoveSlot(virPCIDevice *dev,
unsigned int virPCIDeviceGetReprobe(virPCIDevicePtr dev); unsigned int virPCIDeviceGetReprobe(virPCIDevicePtr dev);
void virPCIDeviceSetReprobe(virPCIDevice *dev, void virPCIDeviceSetReprobe(virPCIDevice *dev,
bool reprobe); bool reprobe);
void virPCIDeviceReattachInit(virPCIDevice *dev);
virPCIDeviceListPtr virPCIDeviceListNew(void); virPCIDeviceListPtr virPCIDeviceListNew(void);

View File

@ -301,7 +301,10 @@ testVirPCIDeviceReattachSingle(const void *opaque)
if (!dev) if (!dev)
goto cleanup; goto cleanup;
virPCIDeviceReattachInit(dev); virPCIDeviceSetUnbindFromStub(dev, true);
virPCIDeviceSetRemoveSlot(dev, true);
virPCIDeviceSetReprobe(dev, true);
if (virPCIDeviceReattach(dev, NULL, NULL) < 0) if (virPCIDeviceReattach(dev, NULL, NULL) < 0)
goto cleanup; goto cleanup;