]> xenbits.xensource.com Git - libvirt.git/commitdiff
pci: Phase out virPCIDeviceReattachInit()
authorAndrea Bolognani <abologna@redhat.com>
Tue, 19 Jan 2016 14:58:31 +0000 (15:58 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 28 Jan 2016 10:31:28 +0000 (11:31 +0100)
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
src/util/virhostdev.c
src/util/virpci.c
src/util/virpci.h
tests/virpcitest.c

index 5d9f970179161c65e5becb76a209490be076738a..3d0ec9d786b6032ee974aabcd8dc661031863382 100644 (file)
@@ -1993,7 +1993,6 @@ virPCIDeviceListSteal;
 virPCIDeviceListStealIndex;
 virPCIDeviceNew;
 virPCIDeviceReattach;
-virPCIDeviceReattachInit;
 virPCIDeviceReset;
 virPCIDeviceSetManaged;
 virPCIDeviceSetRemoveSlot;
index f31ad413edf503649947e6d1eb7a54b9346d6cb7..76c04294868ed65259d7ef4bc699cb3a45601641 100644 (file)
@@ -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)
index 505c1f33a8ff36b8edf379329d9d37a2ad39b81a..f56dbe66b499183559c8c0ad984a4bab6afb4860 100644 (file)
@@ -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)
 {
index d1ac94271f39ced5d38f10eca33e62ed591e118c..0debd7b21366976eba71706b5ffa29959a9b3d13 100644 (file)
@@ -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);
index fb0c970ad85b9bbefb0145d560a9c5d80f127952..6dceef2be788995651e5efcd62b621f334eba1ae 100644 (file)
@@ -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;