]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainDiskLookupByNodename: Remove unused 'idx'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 15 Jul 2020 10:29:34 +0000 (12:29 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 21 Jul 2020 07:52:46 +0000 (09:52 +0200)
All callers pass NULL as the value. Remove the argument.

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

index 131c297a9d0e6ee148b98261553a682864edde78..dbc4326cf4f11a1370e34d6a712ed0c8c789e6ec 100644 (file)
@@ -11585,7 +11585,6 @@ qemuDomainNamespaceTeardownInput(virDomainObjPtr vm,
  * @def: domain definition to look for the disk
  * @nodename: block backend node name to find
  * @src: filled with the specific backing store element if provided
- * @idx: index of @src in the backing chain, if provided
  *
  * Looks up the disk in the domain via @nodename and returns its definition.
  * Optionally fills @src and @idx if provided with the specific backing chain
@@ -11594,24 +11593,17 @@ qemuDomainNamespaceTeardownInput(virDomainObjPtr vm,
 virDomainDiskDefPtr
 qemuDomainDiskLookupByNodename(virDomainDefPtr def,
                                const char *nodename,
-                               virStorageSourcePtr *src,
-                               unsigned int *idx)
+                               virStorageSourcePtr *src)
 {
     size_t i;
-    unsigned int srcindex;
     virStorageSourcePtr tmp = NULL;
 
-    if (!idx)
-        idx = &srcindex;
-
     if (src)
         *src = NULL;
 
-    *idx = 0;
-
     for (i = 0; i < def->ndisks; i++) {
         if ((tmp = virStorageSourceFindByNodeName(def->disks[i]->src,
-                                                  nodename, idx))) {
+                                                  nodename, NULL))) {
             if (src)
                 *src = tmp;
 
index 132c0222465a1fb646eecaa267d1b5aa67f30ab0..29849a7313316140c90d0b1e20c10ee54f8129d4 100644 (file)
@@ -969,8 +969,7 @@ int qemuDomainNamespaceTeardownInput(virDomainObjPtr vm,
 
 virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def,
                                                    const char *nodename,
-                                                   virStorageSourcePtr *src,
-                                                   unsigned int *idx);
+                                                   virStorageSourcePtr *src);
 
 char *qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk,
                                         unsigned int idx);
index 8660cc4c8f1cecd58781fc9840b75bfae6b791f6..c779c2124068c7c936cfaf87b380647acae0e41e 100644 (file)
@@ -880,7 +880,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon G_GNUC_UNUSED,
     if (diskAlias)
         disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL);
     else if (nodename)
-        disk = qemuDomainDiskLookupByNodename(vm->def, nodename, NULL, NULL);
+        disk = qemuDomainDiskLookupByNodename(vm->def, nodename, NULL);
     else
         disk = NULL;
 
@@ -1509,7 +1509,7 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon G_GNUC_UNUSED,
               "threshold '%llu' exceeded by '%llu'",
               nodename, vm, vm->def->name, threshold, excess);
 
-    if ((disk = qemuDomainDiskLookupByNodename(vm->def, nodename, &src, NULL))) {
+    if ((disk = qemuDomainDiskLookupByNodename(vm->def, nodename, &src))) {
         if (virStorageSourceIsLocalStorage(src))
             path = src->path;