[PATCH 1/7] node_device: Use the iterator variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>

As the switch statement checks data.type of the iterator variable @cap
it must use this variable for the update too.

Suggested-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
---
 src/node_device/node_device_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index ba3da6288..002c7616f 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -54,7 +54,7 @@ static int update_caps(virNodeDeviceObjPtr dev)
     while (cap) {
         switch (cap->data.type) {
         case VIR_NODE_DEV_CAP_SCSI_HOST:
-            nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data.scsi_host);
+            nodeDeviceSysfsGetSCSIHostCaps(&cap->data.scsi_host);
             break;
         case VIR_NODE_DEV_CAP_NET:
             if (virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk) < 0)
@@ -65,7 +65,7 @@ static int update_caps(virNodeDeviceObjPtr dev)
             break;
         case VIR_NODE_DEV_CAP_PCI_DEV:
            if (nodeDeviceSysfsGetPCIRelatedDevCaps(dev->def->sysfs_path,
-                                                   &dev->def->caps->data.pci_dev) < 0)
+                                                   &cap->data.pci_dev) < 0)
               return -1;
            break;
 
-- 
2.11.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux