]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
pci: Log debug messages when manipulating the inactive list
authorAndrea Bolognani <abologna@redhat.com>
Thu, 7 Jan 2016 16:50:15 +0000 (17:50 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 8 Jan 2016 08:52:33 +0000 (09:52 +0100)
Most of the changes to the list of active and inactive PCI devices
happen in virHostdev, where they are properly logged.

virPCIDeviceDetach() and virPCIDeviceReattach(), however, change the
inactive list as well, so they should be logging similar messages.

src/util/virpci.c

index 5ebd408700b3d6818cfe07be6bc6bf577a834c4a..505c1f33a8ff36b8edf379329d9d37a2ad39b81a 100644 (file)
@@ -1370,9 +1370,10 @@ virPCIDeviceDetach(virPCIDevicePtr dev,
     /* Add *a copy of* the dev into list inactiveDevs, if
      * it's not already there.
      */
-    if (inactiveDevs && !virPCIDeviceListFind(inactiveDevs, dev) &&
-        virPCIDeviceListAddCopy(inactiveDevs, dev) < 0) {
-        return -1;
+    if (inactiveDevs && !virPCIDeviceListFind(inactiveDevs, dev)) {
+        VIR_DEBUG("Adding PCI device %s to inactive list", dev->name);
+        if (virPCIDeviceListAddCopy(inactiveDevs, dev) < 0)
+            return -1;
     }
 
     return 0;
@@ -1393,8 +1394,10 @@ virPCIDeviceReattach(virPCIDevicePtr dev,
         return -1;
 
     /* Steal the dev from list inactiveDevs */
-    if (inactiveDevs)
+    if (inactiveDevs) {
+        VIR_DEBUG("Removing PCI device %s from inactive list", dev->name);
         virPCIDeviceListDel(inactiveDevs, dev);
+    }
 
     return 0;
 }