From nobody Mon Feb 9 03:30:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594818645; cv=none; d=zohomail.com; s=zohoarc; b=DIweEGSL0ufjJ0E7USAfnQcpVSmA08a8ZcE16gsdHAN1SQNI0PDOSLy5TvvpGQajSqnJ9n7ktYnERtuTqWO5bkLv7FhTI4oaBjUP4EZwEfyE2VQdKSxvEl/Qf/t0ihLo6Z4M5KNw1pTxwaIGWh6a6E4qJTeOpV3Zxy8D7rGM1tk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818645; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SZE8yGlG9zb4rDTkeg5aaKOhkfEL4KfeftoMu6COx1w=; b=iZuGa5d32D4/PNRI7lcdJ4D1EpsC5F5HoRlJFokWtdrSEhkgTUK4HI0swDomOZ3UEcKXOR+aYRtURXVrN98iE1ds67WXjHBm1Cp2uF7gWAZhpN3coQEjdsDv7wKdVwKFypUpj6am5fSGm/w/LYWOv4jTjUgIDh3z3LVxTQmNPEc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594818645321743.4098520168278; Wed, 15 Jul 2020 06:10:45 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-5KQf5t8UOJOlZH4uMMmoTg-1; Wed, 15 Jul 2020 09:10:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B165C800C64; Wed, 15 Jul 2020 13:10:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9023979CF3; Wed, 15 Jul 2020 13:10:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6F7D894F15; Wed, 15 Jul 2020 13:10:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAOXb005775 for ; Wed, 15 Jul 2020 09:10:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id D4EB819079; Wed, 15 Jul 2020 13:10:24 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9A2061983 for ; Wed, 15 Jul 2020 13:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818644; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SZE8yGlG9zb4rDTkeg5aaKOhkfEL4KfeftoMu6COx1w=; b=J6aqIwNL/3IMOO5cvoixd9S3WeDimevNqIju1R4RJNKsZxqk5gucWs3QQKxFaimdtGpuTb QTG5CfwaMhLlrP9sSssi7IOrQ5WlihLle8j8jheKc3DjcAeaGwu3rpBJ/yPb0nraHH45ob jA2DUGuoXtVeZ5+fpJIcuNv7LoFw8lQ= X-MC-Unique: 5KQf5t8UOJOlZH4uMMmoTg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/10] qemuDomainDiskLookupByNodename: Remove unused 'idx' Date: Wed, 15 Jul 2020 15:10:08 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" All callers pass NULL as the value. Remove the argument. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 12 ++---------- src/qemu/qemu_domain.h | 3 +-- src/qemu/qemu_process.c | 4 ++-- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index cfdd9270da..64bd52c51f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11469,7 +11469,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 definitio= n. * Optionally fills @src and @idx if provided with the specific backing ch= ain @@ -11478,24 +11477,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 =3D NULL; - if (!idx) - idx =3D &srcindex; - if (src) *src =3D NULL; - *idx =3D 0; - for (i =3D 0; i < def->ndisks; i++) { if ((tmp =3D virStorageSourceFindByNodeName(def->disks[i]->src, - nodename, idx))) { + nodename, NULL))) { if (src) *src =3D tmp; diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 6944b37ff7..d75fbc0af3 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -959,8 +959,7 @@ int qemuDomainNamespaceTeardownInput(virDomainObjPtr vm, virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def, const char *nodename, - virStorageSourcePtr *sr= c, - unsigned int *idx); + virStorageSourcePtr *sr= c); char *qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, unsigned int idx); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9b6dc8e68b..580abb0fb4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -880,7 +880,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon G_GNUC_UNUS= ED, if (diskAlias) disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL= ); else if (nodename) - disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, NULL, N= ULL); + disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, NULL); else disk =3D 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 =3D qemuDomainDiskLookupByNodename(vm->def, nodename, &src, = NULL))) { + if ((disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, &src))= ) { if (virStorageSourceIsLocalStorage(src)) path =3D src->path; --=20 2.26.2