diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 131c297a9d..dbc4326cf4 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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; diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 132c022246..29849a7313 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -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); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 8660cc4c8f..c779c21240 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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;