[PATCH v2 08/14] nodedev: Alter param to nodeDeviceUpdateCaps

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

 



Rather than taking an virNodeDeviceObjPtr and dereffing the obj->def,
just pass the def.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/node_device/node_device_driver.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 87953f3..b599460 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -49,14 +49,14 @@ virNodeDeviceDriverStatePtr driver;
 
 
 static int
-nodeDeviceUpdateCaps(virNodeDeviceObjPtr dev)
+nodeDeviceUpdateCaps(virNodeDeviceDefPtr def)
 {
-    virNodeDevCapsDefPtr cap = dev->def->caps;
+    virNodeDevCapsDefPtr cap = def->caps;
 
     while (cap) {
         switch (cap->data.type) {
         case VIR_NODE_DEV_CAP_SCSI_HOST:
-            nodeDeviceSysfsGetSCSIHostCaps(&dev->def->caps->data.scsi_host);
+            nodeDeviceSysfsGetSCSIHostCaps(&def->caps->data.scsi_host);
             break;
         case VIR_NODE_DEV_CAP_NET:
             if (virNetDevGetLinkInfo(cap->data.net.ifname, &cap->data.net.lnk) < 0)
@@ -66,8 +66,8 @@ nodeDeviceUpdateCaps(virNodeDeviceObjPtr dev)
                 return -1;
             break;
         case VIR_NODE_DEV_CAP_PCI_DEV:
-           if (nodeDeviceSysfsGetPCIRelatedDevCaps(dev->def->sysfs_path,
-                                                   &dev->def->caps->data.pci_dev) < 0)
+           if (nodeDeviceSysfsGetPCIRelatedDevCaps(def->sysfs_path,
+                                                   &def->caps->data.pci_dev) < 0)
               return -1;
            break;
 
@@ -341,7 +341,7 @@ nodeDeviceGetXMLDesc(virNodeDevicePtr dev,
     if (nodeDeviceUpdateDriverName(obj->def) < 0)
         goto cleanup;
 
-    if (nodeDeviceUpdateCaps(obj) < 0)
+    if (nodeDeviceUpdateCaps(obj->def) < 0)
         goto cleanup;
 
     ret = virNodeDeviceDefFormat(obj->def);
-- 
2.9.4

--
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