[PATCH 3/3] nodedev: Pass driver arg by ref

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

 



Alter virNodeDeviceObjListExport in order to pass the drivers->devs
by reference

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/virnodedeviceobj.c          | 8 ++++----
 src/conf/virnodedeviceobj.h          | 2 +-
 src/node_device/node_device_driver.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 5a8dfe7..fc82799 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -561,7 +561,7 @@ virNodeDeviceMatch(virNodeDeviceObjPtr devobj,
 
 int
 virNodeDeviceObjListExport(virConnectPtr conn,
-                           virNodeDeviceObjList devobjs,
+                           virNodeDeviceObjListPtr devobjs,
                            virNodeDevicePtr **devices,
                            virNodeDeviceObjListFilter filter,
                            unsigned int flags)
@@ -572,11 +572,11 @@ virNodeDeviceObjListExport(virConnectPtr conn,
     int ret = -1;
     size_t i;
 
-    if (devices && VIR_ALLOC_N(tmp_devices, devobjs.count + 1) < 0)
+    if (devices && VIR_ALLOC_N(tmp_devices, devobjs->count + 1) < 0)
         goto cleanup;
 
-    for (i = 0; i < devobjs.count; i++) {
-        virNodeDeviceObjPtr devobj = devobjs.objs[i];
+    for (i = 0; i < devobjs->count; i++) {
+        virNodeDeviceObjPtr devobj = devobjs->objs[i];
         virNodeDeviceObjLock(devobj);
         if ((!filter || filter(conn, devobj->def)) &&
             virNodeDeviceMatch(devobj, flags)) {
diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h
index 0acd8ce..b8b534b 100644
--- a/src/conf/virnodedeviceobj.h
+++ b/src/conf/virnodedeviceobj.h
@@ -94,7 +94,7 @@ virNodeDeviceObjGetNames(virNodeDeviceObjListPtr devs,
 
 int
 virNodeDeviceObjListExport(virConnectPtr conn,
-                           virNodeDeviceObjList devobjs,
+                           virNodeDeviceObjListPtr devobjs,
                            virNodeDevicePtr **devices,
                            virNodeDeviceObjListFilter filter,
                            unsigned int flags);
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index e850a22..269b086 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -213,7 +213,7 @@ nodeConnectListAllNodeDevices(virConnectPtr conn,
         return -1;
 
     nodeDeviceLock();
-    ret = virNodeDeviceObjListExport(conn, driver->devs, devices,
+    ret = virNodeDeviceObjListExport(conn, &driver->devs, devices,
                                      virConnectListAllNodeDevicesCheckACL,
                                      flags);
     nodeDeviceUnlock();
-- 
2.9.3

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