]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virStorageSourceFindByNodeName: Remove unused 'idx' argument
authorPeter Krempa <pkrempa@redhat.com>
Wed, 15 Jul 2020 10:33:34 +0000 (12:33 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 21 Jul 2020 07:52:46 +0000 (09:52 +0200)
None of the callers actually use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_domain.c
src/util/virstoragefile.c
src/util/virstoragefile.h

index dbc4326cf4f11a1370e34d6a712ed0c8c789e6ec..2f3cfd698890e9584fb5c2ba03f8a7d5872909f1 100644 (file)
@@ -2566,15 +2566,15 @@ qemuDomainObjPrivateXMLParseBlockjobNodename(qemuBlockJobDataPtr job,
         return;
 
     if (job->disk &&
-        (*src = virStorageSourceFindByNodeName(job->disk->src, nodename, NULL)))
+        (*src = virStorageSourceFindByNodeName(job->disk->src, nodename)))
         return;
 
     if (job->chain &&
-        (*src = virStorageSourceFindByNodeName(job->chain, nodename, NULL)))
+        (*src = virStorageSourceFindByNodeName(job->chain, nodename)))
         return;
 
     if (job->mirrorChain &&
-        (*src = virStorageSourceFindByNodeName(job->mirrorChain, nodename, NULL)))
+        (*src = virStorageSourceFindByNodeName(job->mirrorChain, nodename)))
         return;
 
     /* the node was in the XML but was not found in the job definitions */
@@ -11602,8 +11602,7 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def,
         *src = NULL;
 
     for (i = 0; i < def->ndisks; i++) {
-        if ((tmp = virStorageSourceFindByNodeName(def->disks[i]->src,
-                                                  nodename, NULL))) {
+        if ((tmp = virStorageSourceFindByNodeName(def->disks[i]->src, nodename))) {
             if (src)
                 *src = tmp;
 
index 274883c4bd7c4fe7547c0dd3b91c91daac797ea9..00d8e16ef99d6b095bfc0bc2bd603b5f3c866a13 100644 (file)
@@ -4589,33 +4589,23 @@ virStorageSourceIsRelative(virStorageSourcePtr src)
  * virStorageSourceFindByNodeName:
  * @top: backing chain top
  * @nodeName: node name to find in backing chain
- * @index: if provided the index in the backing chain
  *
  * Looks up the given storage source in the backing chain and returns the
- * pointer to it. If @index is passed then it's filled by the index in the
- * backing chain. On failure NULL is returned and no error is reported.
+ * pointer to it.
+ * On failure NULL is returned and no error is reported.
  */
 virStorageSourcePtr
 virStorageSourceFindByNodeName(virStorageSourcePtr top,
-                               const char *nodeName,
-                               unsigned int *idx)
+                               const char *nodeName)
 {
     virStorageSourcePtr tmp;
 
-    if (idx)
-        *idx = 0;
-
     for (tmp = top; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
         if ((tmp->nodeformat && STREQ(tmp->nodeformat, nodeName)) ||
             (tmp->nodestorage && STREQ(tmp->nodestorage, nodeName)))
             return tmp;
-
-        if (idx)
-            (*idx)++;
     }
 
-    if (idx)
-        *idx = 0;
     return NULL;
 }
 
index c68bdc9680630f980c91a81e8b2a9b0193292d84..f73b3ee0057f3b548035efba81a772cabe16f290 100644 (file)
@@ -526,8 +526,7 @@ bool virStorageSourceIsRelative(virStorageSourcePtr src);
 
 virStorageSourcePtr
 virStorageSourceFindByNodeName(virStorageSourcePtr top,
-                               const char *nodeName,
-                               unsigned int *index)
+                               const char *nodeName)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 
 void