From 771eaeb2b3961a70f3ecfd5af90bc56c1d43d03a Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Tue, 19 Jan 2016 15:58:31 +0100 Subject: [PATCH] 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. --- src/libvirt_private.syms | 1 - src/util/virhostdev.c | 4 +++- src/util/virpci.c | 8 -------- src/util/virpci.h | 1 - tests/virpcitest.c | 5 ++++- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 5d9f970179..3d0ec9d786 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1993,7 +1993,6 @@ virPCIDeviceListSteal; virPCIDeviceListStealIndex; virPCIDeviceNew; virPCIDeviceReattach; -virPCIDeviceReattachInit; virPCIDeviceReset; virPCIDeviceSetManaged; virPCIDeviceSetRemoveSlot; diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index f31ad413ed..76c0429486 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -1619,7 +1619,9 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr, if (virHostdevIsPCINodeDeviceUsed(virPCIDeviceGetAddress(pci), &data)) goto out; - virPCIDeviceReattachInit(pci); + virPCIDeviceSetUnbindFromStub(pci, true); + virPCIDeviceSetRemoveSlot(pci, true); + virPCIDeviceSetReprobe(pci, true); if (virPCIDeviceReattach(pci, hostdev_mgr->activePCIHostdevs, hostdev_mgr->inactivePCIHostdevs) < 0) diff --git a/src/util/virpci.c b/src/util/virpci.c index 505c1f33a8..f56dbe66b4 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1771,14 +1771,6 @@ virPCIDeviceGetUsedBy(virPCIDevicePtr dev, *dom_name = dev->used_by_domname; } -void virPCIDeviceReattachInit(virPCIDevicePtr pci) -{ - pci->unbind_from_stub = true; - pci->remove_slot = true; - pci->reprobe = true; -} - - virPCIDeviceListPtr virPCIDeviceListNew(void) { diff --git a/src/util/virpci.h b/src/util/virpci.h index d1ac94271f..0debd7b213 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -119,7 +119,6 @@ void virPCIDeviceSetRemoveSlot(virPCIDevice *dev, unsigned int virPCIDeviceGetReprobe(virPCIDevicePtr dev); void virPCIDeviceSetReprobe(virPCIDevice *dev, bool reprobe); -void virPCIDeviceReattachInit(virPCIDevice *dev); virPCIDeviceListPtr virPCIDeviceListNew(void); diff --git a/tests/virpcitest.c b/tests/virpcitest.c index fb0c970ad8..6dceef2be7 100644 --- a/tests/virpcitest.c +++ b/tests/virpcitest.c @@ -301,7 +301,10 @@ testVirPCIDeviceReattachSingle(const void *opaque) if (!dev) goto cleanup; - virPCIDeviceReattachInit(dev); + virPCIDeviceSetUnbindFromStub(dev, true); + virPCIDeviceSetRemoveSlot(dev, true); + virPCIDeviceSetReprobe(dev, true); + if (virPCIDeviceReattach(dev, NULL, NULL) < 0) goto cleanup;