From nobody Sun Feb 8 18:31:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594818660; cv=none; d=zohomail.com; s=zohoarc; b=SSBZpH5niODGdHdmKZ8N2RAQcjPYI6PCnSXXEKcnqS0/m4Dk6R/cbzSJ8SYofIlgCuhfGk+ZVreNbA+qirESuzAK4fE9XP79CdpT6jMJfv0VwWLyi1emC93/oXP+rPyS4t4ilii+O/7bCTA7Hl0Fx9BY0ZAk/TctUDBhqIl/PR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818660; 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=tZ42E9SthPe+IhHDWD1wn8bpkG6YPUCubVWAi+HeMb8=; b=CkCDAwDxjV6cH5kms1uQMfEQMMBjDgCfTF6edMOG+G31Wt7r+PkwhdSoYMwORWlcihkAHiAYJPRZYNFGXl7fVvUykfrPWDWh/cKT9vZ5p4G9XcDOtPYWa28ayt3ukqWnknysqSULUarBkTbaE8uOmoQPFkE+8V2U8+T+5yKUwuc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594818660955691.8897378211191; Wed, 15 Jul 2020 06:11:00 -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-204-N6-BTm-GMeK-1--JBYbUrg-1; Wed, 15 Jul 2020 09:10:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8105F19200E6; Wed, 15 Jul 2020 13:10:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5FA5110013C3; Wed, 15 Jul 2020 13:10:48 +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 2D0C21800B70; Wed, 15 Jul 2020 13:10:48 +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 06FDAQqk005781 for ; Wed, 15 Jul 2020 09:10:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1BEB560BF4; Wed, 15 Jul 2020 13:10:26 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62B2019079 for ; Wed, 15 Jul 2020 13:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818659; 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=tZ42E9SthPe+IhHDWD1wn8bpkG6YPUCubVWAi+HeMb8=; b=KBMKxtRqgILuc6HWhXNjOu/LjYbKJkWklUX9qb06YH5gqWWWFGs6+yR/PCFLMK7Fo/fAyz kO1JWGGNUEuC+c/OccW01DdK5sVLJJXB2uhTy3cFcY6s5pQQ/nqKBOGkyWtfcTypvyt4vQ mOEX9fZeH2TMK55EZ5KpsoPhn8nqPcg= X-MC-Unique: N6-BTm-GMeK-1--JBYbUrg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/10] virStorageSourceFindByNodeName: Remove unused 'idx' argument Date: Wed, 15 Jul 2020 15:10:09 +0200 Message-Id: <222f08120787bc3497e8df5f01296edd59e01fbc.1594818495.git.pkrempa@redhat.com> 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.84 on 10.5.11.22 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" None of the callers actually use it. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 9 ++++----- src/util/virstoragefile.c | 16 +++------------- src/util/virstoragefile.h | 3 +-- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 64bd52c51f..ed7ec77ed4 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2498,15 +2498,15 @@ qemuDomainObjPrivateXMLParseBlockjobNodename(qemuBl= ockJobDataPtr job, return; if (job->disk && - (*src =3D virStorageSourceFindByNodeName(job->disk->src, nodename,= NULL))) + (*src =3D virStorageSourceFindByNodeName(job->disk->src, nodename)= )) return; if (job->chain && - (*src =3D virStorageSourceFindByNodeName(job->chain, nodename, NUL= L))) + (*src =3D virStorageSourceFindByNodeName(job->chain, nodename))) return; if (job->mirrorChain && - (*src =3D virStorageSourceFindByNodeName(job->mirrorChain, nodenam= e, NULL))) + (*src =3D virStorageSourceFindByNodeName(job->mirrorChain, nodenam= e))) return; /* the node was in the XML but was not found in the job definitions */ @@ -11486,8 +11486,7 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def, *src =3D NULL; for (i =3D 0; i < def->ndisks; i++) { - if ((tmp =3D virStorageSourceFindByNodeName(def->disks[i]->src, - nodename, NULL))) { + if ((tmp =3D virStorageSourceFindByNodeName(def->disks[i]->src, no= dename))) { if (src) *src =3D tmp; diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 274883c4bd..00d8e16ef9 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -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 =3D 0; - for (tmp =3D top; virStorageSourceIsBacking(tmp); tmp =3D tmp->backing= Store) { if ((tmp->nodeformat && STREQ(tmp->nodeformat, nodeName)) || (tmp->nodestorage && STREQ(tmp->nodestorage, nodeName))) return tmp; - - if (idx) - (*idx)++; } - if (idx) - *idx =3D 0; return NULL; } diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index c68bdc9680..f73b3ee005 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -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 --=20 2.26.2