[PATCH v3 07/12] nodedev: Alter node device obj list function names

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

 



Ensure that any function that walks the node device object list is prefixed
by virNodeDeviceObjList.

Also, modify the @filter param name for virNodeDeviceObjListExport to
be @aclfilter.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/virnodedeviceobj.c          | 109 ++++++++++++++++++-----------------
 src/conf/virnodedeviceobj.h          |  42 +++++++-------
 src/libvirt_private.syms             |  14 ++---
 src/node_device/node_device_driver.c |  20 +++----
 src/node_device/node_device_hal.c    |  12 ++--
 src/node_device/node_device_udev.c   |  14 ++---
 src/test/test_driver.c               |  28 ++++-----
 7 files changed, 121 insertions(+), 118 deletions(-)

diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 4a25d95..fab1cfd 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -166,8 +166,8 @@ virNodeDeviceFindVPORTCapDef(const virNodeDeviceObj *obj)
 
 
 virNodeDeviceObjPtr
-virNodeDeviceObjFindBySysfsPath(virNodeDeviceObjListPtr devs,
-                                const char *sysfs_path)
+virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjListPtr devs,
+                                    const char *sysfs_path)
 {
     size_t i;
 
@@ -185,8 +185,8 @@ virNodeDeviceObjFindBySysfsPath(virNodeDeviceObjListPtr devs,
 
 
 virNodeDeviceObjPtr
-virNodeDeviceObjFindByName(virNodeDeviceObjListPtr devs,
-                           const char *name)
+virNodeDeviceObjListFindByName(virNodeDeviceObjListPtr devs,
+                               const char *name)
 {
     size_t i;
 
@@ -202,9 +202,9 @@ virNodeDeviceObjFindByName(virNodeDeviceObjListPtr devs,
 
 
 static virNodeDeviceObjPtr
-virNodeDeviceFindByWWNs(virNodeDeviceObjListPtr devs,
-                        const char *parent_wwnn,
-                        const char *parent_wwpn)
+virNodeDeviceObjListFindByWWNs(virNodeDeviceObjListPtr devs,
+                               const char *parent_wwnn,
+                               const char *parent_wwpn)
 {
     size_t i;
 
@@ -224,8 +224,8 @@ virNodeDeviceFindByWWNs(virNodeDeviceObjListPtr devs,
 
 
 static virNodeDeviceObjPtr
-virNodeDeviceFindByFabricWWN(virNodeDeviceObjListPtr devs,
-                             const char *parent_fabric_wwn)
+virNodeDeviceObjListFindByFabricWWN(virNodeDeviceObjListPtr devs,
+                                    const char *parent_fabric_wwn)
 {
     size_t i;
 
@@ -244,8 +244,8 @@ virNodeDeviceFindByFabricWWN(virNodeDeviceObjListPtr devs,
 
 
 static virNodeDeviceObjPtr
-virNodeDeviceFindByCap(virNodeDeviceObjListPtr devs,
-                       const char *cap)
+virNodeDeviceObjListFindByCap(virNodeDeviceObjListPtr devs,
+                              const char *cap)
 {
     size_t i;
 
@@ -297,12 +297,12 @@ virNodeDeviceObjListFree(virNodeDeviceObjListPtr devs)
 
 
 virNodeDeviceObjPtr
-virNodeDeviceObjAssignDef(virNodeDeviceObjListPtr devs,
-                          virNodeDeviceDefPtr def)
+virNodeDeviceObjListAssignDef(virNodeDeviceObjListPtr devs,
+                              virNodeDeviceDefPtr def)
 {
     virNodeDeviceObjPtr obj;
 
-    if ((obj = virNodeDeviceObjFindByName(devs, def->name))) {
+    if ((obj = virNodeDeviceObjListFindByName(devs, def->name))) {
         virNodeDeviceDefFree(obj->def);
         obj->def = def;
         return obj;
@@ -323,8 +323,8 @@ virNodeDeviceObjAssignDef(virNodeDeviceObjListPtr devs,
 
 
 void
-virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs,
-                       virNodeDeviceObjPtr obj)
+virNodeDeviceObjListRemove(virNodeDeviceObjListPtr devs,
+                           virNodeDeviceObjPtr obj)
 {
     size_t i;
 
@@ -373,14 +373,14 @@ virNodeDeviceFindFCParentHost(virNodeDeviceObjPtr obj)
 
 
 static int
-virNodeDeviceGetParentHostByParent(virNodeDeviceObjListPtr devs,
-                                   const char *dev_name,
-                                   const char *parent_name)
+virNodeDeviceObjListGetParentHostByParent(virNodeDeviceObjListPtr devs,
+                                          const char *dev_name,
+                                          const char *parent_name)
 {
     virNodeDeviceObjPtr obj = NULL;
     int ret;
 
-    if (!(obj = virNodeDeviceObjFindByName(devs, parent_name))) {
+    if (!(obj = virNodeDeviceObjListFindByName(devs, parent_name))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Could not find parent device for '%s'"),
                        dev_name);
@@ -396,15 +396,16 @@ virNodeDeviceGetParentHostByParent(virNodeDeviceObjListPtr devs,
 
 
 static int
-virNodeDeviceGetParentHostByWWNs(virNodeDeviceObjListPtr devs,
-                                 const char *dev_name,
-                                 const char *parent_wwnn,
-                                 const char *parent_wwpn)
+virNodeDeviceObjListGetParentHostByWWNs(virNodeDeviceObjListPtr devs,
+                                        const char *dev_name,
+                                        const char *parent_wwnn,
+                                        const char *parent_wwpn)
 {
     virNodeDeviceObjPtr obj = NULL;
     int ret;
 
-    if (!(obj = virNodeDeviceFindByWWNs(devs, parent_wwnn, parent_wwpn))) {
+    if (!(obj = virNodeDeviceObjListFindByWWNs(devs, parent_wwnn,
+                                               parent_wwpn))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Could not find parent device for '%s'"),
                        dev_name);
@@ -420,14 +421,14 @@ virNodeDeviceGetParentHostByWWNs(virNodeDeviceObjListPtr devs,
 
 
 static int
-virNodeDeviceGetParentHostByFabricWWN(virNodeDeviceObjListPtr devs,
-                                      const char *dev_name,
-                                      const char *parent_fabric_wwn)
+virNodeDeviceObjListGetParentHostByFabricWWN(virNodeDeviceObjListPtr devs,
+                                             const char *dev_name,
+                                             const char *parent_fabric_wwn)
 {
     virNodeDeviceObjPtr obj = NULL;
     int ret;
 
-    if (!(obj = virNodeDeviceFindByFabricWWN(devs, parent_fabric_wwn))) {
+    if (!(obj = virNodeDeviceObjListFindByFabricWWN(devs, parent_fabric_wwn))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Could not find parent device for '%s'"),
                        dev_name);
@@ -443,13 +444,13 @@ virNodeDeviceGetParentHostByFabricWWN(virNodeDeviceObjListPtr devs,
 
 
 static int
-virNodeDeviceFindVportParentHost(virNodeDeviceObjListPtr devs)
+virNodeDeviceObjListFindVportParentHost(virNodeDeviceObjListPtr devs)
 {
     virNodeDeviceObjPtr obj = NULL;
     const char *cap = virNodeDevCapTypeToString(VIR_NODE_DEV_CAP_VPORTS);
     int ret;
 
-    if (!(obj = virNodeDeviceFindByCap(devs, cap))) {
+    if (!(obj = virNodeDeviceObjListFindByCap(devs, cap))) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Could not find any vport capable device"));
         return -1;
@@ -464,26 +465,26 @@ virNodeDeviceFindVportParentHost(virNodeDeviceObjListPtr devs)
 
 
 int
-virNodeDeviceObjGetParentHost(virNodeDeviceObjListPtr devs,
-                              virNodeDeviceDefPtr def,
-                              int create)
+virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs,
+                                  virNodeDeviceDefPtr def,
+                                  int create)
 {
     int parent_host = -1;
 
     if (def->parent) {
-        parent_host = virNodeDeviceGetParentHostByParent(devs, def->name,
-                                                         def->parent);
+        parent_host = virNodeDeviceObjListGetParentHostByParent(devs, def->name,
+                                                                def->parent);
     } else if (def->parent_wwnn && def->parent_wwpn) {
-        parent_host = virNodeDeviceGetParentHostByWWNs(devs, def->name,
-                                                       def->parent_wwnn,
-                                                       def->parent_wwpn);
+        parent_host = virNodeDeviceObjListGetParentHostByWWNs(devs, def->name,
+                                                              def->parent_wwnn,
+                                                              def->parent_wwpn);
     } else if (def->parent_fabric_wwn) {
         parent_host =
-            virNodeDeviceGetParentHostByFabricWWN(devs, def->name,
-                                                  def->parent_fabric_wwn);
+            virNodeDeviceObjListGetParentHostByFabricWWN(devs, def->name,
+                                                         def->parent_fabric_wwn);
     } else if (create == CREATE_DEVICE) {
         /* Try to find a vport capable scsi_host when no parent supplied */
-        parent_host = virNodeDeviceFindVportParentHost(devs);
+        parent_host = virNodeDeviceObjListFindVportParentHost(devs);
     }
 
     return parent_host;
@@ -555,10 +556,10 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr obj,
 
 
 int
-virNodeDeviceObjNumOfDevices(virNodeDeviceObjListPtr devs,
-                             virConnectPtr conn,
-                             const char *cap,
-                             virNodeDeviceObjListFilter aclfilter)
+virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs,
+                                 virConnectPtr conn,
+                                 const char *cap,
+                                 virNodeDeviceObjListFilter aclfilter)
 {
     size_t i;
     int ndevs = 0;
@@ -577,12 +578,12 @@ virNodeDeviceObjNumOfDevices(virNodeDeviceObjListPtr devs,
 
 
 int
-virNodeDeviceObjGetNames(virNodeDeviceObjListPtr devs,
-                         virConnectPtr conn,
-                         virNodeDeviceObjListFilter aclfilter,
-                         const char *cap,
-                         char **const names,
-                         int maxnames)
+virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs,
+                             virConnectPtr conn,
+                             virNodeDeviceObjListFilter aclfilter,
+                             const char *cap,
+                             char **const names,
+                             int maxnames)
 {
     int nnames = 0;
     size_t i;
@@ -646,7 +647,7 @@ int
 virNodeDeviceObjListExport(virConnectPtr conn,
                            virNodeDeviceObjListPtr devs,
                            virNodeDevicePtr **devices,
-                           virNodeDeviceObjListFilter filter,
+                           virNodeDeviceObjListFilter aclfilter,
                            unsigned int flags)
 {
     virNodeDevicePtr *tmp_devices = NULL;
@@ -661,7 +662,7 @@ virNodeDeviceObjListExport(virConnectPtr conn,
     for (i = 0; i < devs->count; i++) {
         virNodeDeviceObjPtr obj = devs->objs[i];
         virNodeDeviceObjLock(obj);
-        if ((!filter || filter(conn, obj->def)) &&
+        if ((!aclfilter || aclfilter(conn, obj->def)) &&
             virNodeDeviceMatch(obj, flags)) {
             if (devices) {
                 if (!(device = virGetNodeDevice(conn, obj->def->name)) ||
diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h
index 77250a0..6194c6c 100644
--- a/src/conf/virnodedeviceobj.h
+++ b/src/conf/virnodedeviceobj.h
@@ -44,25 +44,25 @@ virNodeDeviceDefPtr
 virNodeDeviceObjGetDef(virNodeDeviceObjPtr obj);
 
 virNodeDeviceObjPtr
-virNodeDeviceObjFindByName(virNodeDeviceObjListPtr devs,
-                           const char *name);
+virNodeDeviceObjListFindByName(virNodeDeviceObjListPtr devs,
+                               const char *name);
 
 virNodeDeviceObjPtr
-virNodeDeviceObjFindBySysfsPath(virNodeDeviceObjListPtr devs,
-                                const char *sysfs_path)
+virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjListPtr devs,
+                                    const char *sysfs_path)
     ATTRIBUTE_NONNULL(2);
 
 virNodeDeviceObjPtr
-virNodeDeviceObjAssignDef(virNodeDeviceObjListPtr devs,
-                          virNodeDeviceDefPtr def);
+virNodeDeviceObjListAssignDef(virNodeDeviceObjListPtr devs,
+                              virNodeDeviceDefPtr def);
 
 void
-virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs,
-                       virNodeDeviceObjPtr dev);
+virNodeDeviceObjListRemove(virNodeDeviceObjListPtr devs,
+                           virNodeDeviceObjPtr dev);
 
 int
-virNodeDeviceObjGetParentHost(virNodeDeviceObjListPtr devs,
-                              virNodeDeviceDefPtr def,
+virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs,
+                                  virNodeDeviceDefPtr def,
                               int create);
 
 void
@@ -85,24 +85,24 @@ typedef bool
                               virNodeDeviceDefPtr def);
 
 int
-virNodeDeviceObjNumOfDevices(virNodeDeviceObjListPtr devs,
-                             virConnectPtr conn,
-                             const char *cap,
-                             virNodeDeviceObjListFilter aclfilter);
+virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs,
+                                 virConnectPtr conn,
+                                 const char *cap,
+                                 virNodeDeviceObjListFilter aclfilter);
 
 int
-virNodeDeviceObjGetNames(virNodeDeviceObjListPtr devs,
-                         virConnectPtr conn,
-                         virNodeDeviceObjListFilter aclfilter,
-                         const char *cap,
-                         char **const names,
-                         int maxnames);
+virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs,
+                             virConnectPtr conn,
+                             virNodeDeviceObjListFilter aclfilter,
+                             const char *cap,
+                             char **const names,
+                             int maxnames);
 
 int
 virNodeDeviceObjListExport(virConnectPtr conn,
                            virNodeDeviceObjListPtr devobjs,
                            virNodeDevicePtr **devices,
-                           virNodeDeviceObjListFilter filter,
+                           virNodeDeviceObjListFilter aclfilter,
                            unsigned int flags);
 
 #endif /* __VIRNODEDEVICEOBJ_H__ */
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 77f56c2..b511feb 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -956,19 +956,19 @@ virNetworkObjUpdateAssignDef;
 
 
 # conf/virnodedeviceobj.h
-virNodeDeviceObjAssignDef;
-virNodeDeviceObjFindByName;
-virNodeDeviceObjFindBySysfsPath;
 virNodeDeviceObjFree;
 virNodeDeviceObjGetDef;
-virNodeDeviceObjGetNames;
-virNodeDeviceObjGetParentHost;
+virNodeDeviceObjListAssignDef;
 virNodeDeviceObjListExport;
+virNodeDeviceObjListFindByName;
+virNodeDeviceObjListFindBySysfsPath;
 virNodeDeviceObjListFree;
+virNodeDeviceObjListGetNames;
+virNodeDeviceObjListGetParentHost;
 virNodeDeviceObjListNew;
+virNodeDeviceObjListNumOfDevices;
+virNodeDeviceObjListRemove;
 virNodeDeviceObjLock;
-virNodeDeviceObjNumOfDevices;
-virNodeDeviceObjRemove;
 virNodeDeviceObjUnlock;
 
 
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index fc9d0b0..348539f 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -182,8 +182,8 @@ nodeNumOfDevices(virConnectPtr conn,
     virCheckFlags(0, -1);
 
     nodeDeviceLock();
-    ndevs = virNodeDeviceObjNumOfDevices(driver->devs, conn, cap,
-                                         virNodeNumOfDevicesCheckACL);
+    ndevs = virNodeDeviceObjListNumOfDevices(driver->devs, conn, cap,
+                                             virNodeNumOfDevicesCheckACL);
     nodeDeviceUnlock();
 
     return ndevs;
@@ -205,9 +205,9 @@ nodeListDevices(virConnectPtr conn,
     virCheckFlags(0, -1);
 
     nodeDeviceLock();
-    nnames = virNodeDeviceObjGetNames(driver->devs, conn,
-                                      virNodeListDevicesCheckACL,
-                                      cap, names, maxnames);
+    nnames = virNodeDeviceObjListGetNames(driver->devs, conn,
+                                          virNodeListDevicesCheckACL,
+                                          cap, names, maxnames);
     nodeDeviceUnlock();
 
     return nnames;
@@ -241,7 +241,7 @@ nodeDeviceObjFindByName(const char *name)
     virNodeDeviceObjPtr obj;
 
     nodeDeviceLock();
-    obj = virNodeDeviceObjFindByName(driver->devs, name);
+    obj = virNodeDeviceObjListFindByName(driver->devs, name);
     nodeDeviceUnlock();
 
     if (!obj) {
@@ -587,8 +587,8 @@ nodeDeviceCreateXML(virConnectPtr conn,
     if (virNodeDeviceGetWWNs(def, &wwnn, &wwpn) == -1)
         goto cleanup;
 
-    if ((parent_host = virNodeDeviceObjGetParentHost(driver->devs, def,
-                                                     CREATE_DEVICE)) < 0)
+    if ((parent_host = virNodeDeviceObjListGetParentHost(driver->devs, def,
+                                                         CREATE_DEVICE)) < 0)
         goto cleanup;
 
     if (virVHBAManageVport(parent_host, wwpn, wwnn, VPORT_CREATE) < 0)
@@ -639,8 +639,8 @@ nodeDeviceDestroy(virNodeDevicePtr device)
      * or parent_fabric_wwn) and drop the object lock. */
     virNodeDeviceObjUnlock(obj);
     obj = NULL;
-    if ((parent_host = virNodeDeviceObjGetParentHost(driver->devs, def,
-                                                     EXISTING_DEVICE)) < 0)
+    if ((parent_host = virNodeDeviceObjListGetParentHost(driver->devs, def,
+                                                         EXISTING_DEVICE)) < 0)
         goto cleanup;
 
     if (virVHBAManageVport(parent_host, wwpn, wwnn, VPORT_DELETE) < 0)
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index f02fbe4..5521287 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -482,7 +482,7 @@ dev_create(const char *udi)
     /* Some devices don't have a path in sysfs, so ignore failure */
     (void)get_str_prop(ctx, udi, "linux.sysfs_path", &devicePath);
 
-    if (!(obj = virNodeDeviceObjAssignDef(driver->devs, def))) {
+    if (!(obj = virNodeDeviceObjListAssignDef(driver->devs, def))) {
         VIR_FREE(devicePath);
         goto failure;
     }
@@ -509,12 +509,12 @@ dev_refresh(const char *udi)
     virNodeDeviceObjPtr obj;
 
     nodeDeviceLock();
-    obj = virNodeDeviceObjFindByName(driver->devs, name);
+    obj = virNodeDeviceObjListFindByName(driver->devs, name);
     if (obj) {
         /* Simply "rediscover" device -- incrementally handling changes
          * to sub-capabilities (like net.80203) is nasty ... so avoid it.
          */
-        virNodeDeviceObjRemove(driver->devs, obj);
+        virNodeDeviceObjListRemove(driver->devs, obj);
     } else {
         VIR_DEBUG("no device named %s", name);
     }
@@ -541,10 +541,10 @@ device_removed(LibHalContext *ctx ATTRIBUTE_UNUSED,
     virNodeDeviceObjPtr obj;
 
     nodeDeviceLock();
-    obj = virNodeDeviceObjFindByName(driver->devs, name);
+    obj = virNodeDeviceObjListFindByName(driver->devs, name);
     VIR_DEBUG("%s", name);
     if (obj) {
-        virNodeDeviceObjRemove(driver->devs, obj);
+        virNodeDeviceObjListRemove(driver->devs, obj);
         virNodeDeviceObjFree(obj);
     } else {
         VIR_DEBUG("no device named %s", name);
@@ -562,7 +562,7 @@ device_cap_added(LibHalContext *ctx,
     virNodeDeviceDefPtr def;
 
     nodeDeviceLock();
-    obj = virNodeDeviceObjFindByName(driver->devs, name);
+    obj = virNodeDeviceObjListFindByName(driver->devs, name);
     nodeDeviceUnlock();
     VIR_DEBUG("%s %s", cap, name);
     if (obj) {
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 40f12e3..a210fe1 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1318,7 +1318,7 @@ udevRemoveOneDevice(struct udev_device *device)
     const char *name = NULL;
 
     name = udev_device_get_syspath(device);
-    if (!(obj = virNodeDeviceObjFindBySysfsPath(driver->devs, name))) {
+    if (!(obj = virNodeDeviceObjListFindBySysfsPath(driver->devs, name))) {
         VIR_DEBUG("Failed to find device to remove that has udev name '%s'",
                   name);
         return -1;
@@ -1331,7 +1331,7 @@ udevRemoveOneDevice(struct udev_device *device)
 
     VIR_DEBUG("Removing device '%s' with sysfs path '%s'",
               def->name, name);
-    virNodeDeviceObjRemove(driver->devs, obj);
+    virNodeDeviceObjListRemove(driver->devs, obj);
     virNodeDeviceObjFree(obj);
 
     if (event)
@@ -1365,8 +1365,8 @@ udevSetParent(struct udev_device *device,
             goto cleanup;
         }
 
-        if ((obj = virNodeDeviceObjFindBySysfsPath(driver->devs,
-                                                   parent_sysfs_path))) {
+        if ((obj = virNodeDeviceObjListFindBySysfsPath(driver->devs,
+                                                       parent_sysfs_path))) {
             objdef = virNodeDeviceObjGetDef(obj);
             if (VIR_STRDUP(def->parent, objdef->name) < 0) {
                 virNodeDeviceObjUnlock(obj);
@@ -1424,7 +1424,7 @@ udevAddOneDevice(struct udev_device *device)
     if (udevSetParent(device, def) != 0)
         goto cleanup;
 
-    obj = virNodeDeviceObjFindByName(driver->devs, def->name);
+    obj = virNodeDeviceObjListFindByName(driver->devs, def->name);
     if (obj) {
         virNodeDeviceObjUnlock(obj);
         new_device = false;
@@ -1432,7 +1432,7 @@ udevAddOneDevice(struct udev_device *device)
 
     /* If this is a device change, the old definition will be freed
      * and the current definition will take its place. */
-    if (!(obj = virNodeDeviceObjAssignDef(driver->devs, def)))
+    if (!(obj = virNodeDeviceObjListAssignDef(driver->devs, def)))
         goto cleanup;
     objdef = virNodeDeviceObjGetDef(obj);
 
@@ -1722,7 +1722,7 @@ udevSetupSystemDev(void)
     udevGetDMIData(&def->caps->data.system);
 #endif
 
-    if (!(obj = virNodeDeviceObjAssignDef(driver->devs, def)))
+    if (!(obj = virNodeDeviceObjListAssignDef(driver->devs, def)))
         goto cleanup;
 
     virNodeDeviceObjUnlock(obj);
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 6a74368..67fe252 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1170,7 +1170,7 @@ testParseNodedevs(testDriverPtr privconn,
         if (!def)
             goto error;
 
-        if (!(obj = virNodeDeviceObjAssignDef(privconn->devs, def))) {
+        if (!(obj = virNodeDeviceObjListAssignDef(privconn->devs, def))) {
             virNodeDeviceDefFree(def);
             goto error;
         }
@@ -4520,7 +4520,8 @@ testDestroyVport(testDriverPtr privconn,
      *
      * Reaching across the boundaries of space and time into the
      * Node Device in order to remove */
-    if (!(obj = virNodeDeviceObjFindByName(privconn->devs, "scsi_host12"))) {
+    if (!(obj = virNodeDeviceObjListFindByName(privconn->devs,
+                                               "scsi_host12"))) {
         virReportError(VIR_ERR_NO_NODE_DEVICE, "%s",
                        _("no node device with matching name 'scsi_host12'"));
         return -1;
@@ -4530,7 +4531,7 @@ testDestroyVport(testDriverPtr privconn,
                                            VIR_NODE_DEVICE_EVENT_DELETED,
                                            0);
 
-    virNodeDeviceObjRemove(privconn->devs, obj);
+    virNodeDeviceObjListRemove(privconn->devs, obj);
     virNodeDeviceObjFree(obj);
     obj = NULL;
 
@@ -5263,7 +5264,7 @@ testNodeDeviceObjFindByName(testDriverPtr driver,
     virNodeDeviceObjPtr obj;
 
     testDriverLock(driver);
-    obj = virNodeDeviceObjFindByName(driver->devs, name);
+    obj = virNodeDeviceObjListFindByName(driver->devs, name);
     testDriverUnlock(driver);
 
     if (!obj)
@@ -5286,7 +5287,7 @@ testNodeNumOfDevices(virConnectPtr conn,
     virCheckFlags(0, -1);
 
     testDriverLock(driver);
-    ndevs = virNodeDeviceObjNumOfDevices(driver->devs, conn, cap, NULL);
+    ndevs = virNodeDeviceObjListNumOfDevices(driver->devs, conn, cap, NULL);
     testDriverUnlock(driver);
 
     return ndevs;
@@ -5306,8 +5307,8 @@ testNodeListDevices(virConnectPtr conn,
     virCheckFlags(0, -1);
 
     testDriverLock(driver);
-    nnames = virNodeDeviceObjGetNames(driver->devs, conn, NULL,
-                                     cap, names, maxnames);
+    nnames = virNodeDeviceObjListGetNames(driver->devs, conn, NULL,
+                                          cap, names, maxnames);
     testDriverUnlock(driver);
 
     return nnames;
@@ -5453,7 +5454,8 @@ testNodeDeviceMockCreateVport(testDriverPtr driver,
      * using the scsi_host11 definition, changing the name and the
      * scsi_host capability fields before calling virNodeDeviceAssignDef
      * to add the def to the node device objects list. */
-    if (!(objcopy = virNodeDeviceObjFindByName(driver->devs, "scsi_host11")))
+    if (!(objcopy = virNodeDeviceObjListFindByName(driver->devs,
+                                                   "scsi_host11")))
         goto cleanup;
 
     xml = virNodeDeviceDefFormat(virNodeDeviceObjGetDef(objcopy));
@@ -5493,7 +5495,7 @@ testNodeDeviceMockCreateVport(testDriverPtr driver,
         caps = caps->next;
     }
 
-    if (!(obj = virNodeDeviceObjAssignDef(driver->devs, def)))
+    if (!(obj = virNodeDeviceObjListAssignDef(driver->devs, def)))
         goto cleanup;
     def = NULL;
     objdef = virNodeDeviceObjGetDef(obj);
@@ -5538,7 +5540,7 @@ testNodeDeviceCreateXML(virConnectPtr conn,
     /* Unlike the "real" code we don't need the parent_host in order to
      * call virVHBAManageVport, but still let's make sure the code finds
      * something valid and no one messed up the mock environment. */
-    if (virNodeDeviceObjGetParentHost(driver->devs, def, CREATE_DEVICE) < 0)
+    if (virNodeDeviceObjListGetParentHost(driver->devs, def, CREATE_DEVICE) < 0)
         goto cleanup;
 
     /* In the real code, we'd call virVHBAManageVport followed by
@@ -5599,8 +5601,8 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
 
     /* We do this just for basic validation, but also avoid finding a
      * vport capable HBA if for some reason our vHBA doesn't exist */
-    if (virNodeDeviceObjGetParentHost(driver->devs, def,
-                                      EXISTING_DEVICE) < 0) {
+    if (virNodeDeviceObjListGetParentHost(driver->devs, def,
+                                          EXISTING_DEVICE) < 0) {
         obj = NULL;
         goto cleanup;
     }
@@ -5610,7 +5612,7 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
                                            0);
 
     virNodeDeviceObjLock(obj);
-    virNodeDeviceObjRemove(driver->devs, obj);
+    virNodeDeviceObjListRemove(driver->devs, obj);
     virNodeDeviceObjFree(obj);
     obj = NULL;
 
-- 
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