From nobody Mon Feb 9 16:53:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1606911345; cv=none; d=zohomail.com; s=zohoarc; b=i4KNXy0GwhNB6Ypzm94h/8UuKUoniX7kK3uZoVSBn8LtrSlqUSyF+nJkq+My/ItK3v5bbAqHCZ05kRUteD03ouzppMQIGl2ttisDlOzWD25+dLlozRW2fizuqI7rAlPqQ7NFhXRpcIMEBbQ9Zi4snV0IgCSwFaP59sZFjejO/zA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606911345; 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=T2Bqp12Ruqbsz9tAC9rcxRofvUgOvIkYEOwBKcrED60=; b=CisrbWL/qFALWyu0+HuGgnDL+0VCxseDG5ehK5A5R6NnpW+PZ2HrK3QJqtirshRA1VLUMpEkHWQPuS1DvlpetKyYw+u8lGFJeuB/VD3V+jD8R5vpZ6lvlopZDwfZzqok0gPHE4Lm8yplSmzIKz3kPXb+L64njXaueWFRfKgod8s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606911345857643.4353092457233; Wed, 2 Dec 2020 04:15:45 -0800 (PST) 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-108-sECXqWvnN-Gmg0YGcLqZlA-1; Wed, 02 Dec 2020 07:15:41 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B75BB10151EB; Wed, 2 Dec 2020 12:15:35 +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 9515C60BFA; Wed, 2 Dec 2020 12:15:35 +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 5FF035003B; Wed, 2 Dec 2020 12:15:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B2CFW5u032010 for ; Wed, 2 Dec 2020 07:15:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2CCD1189B6; Wed, 2 Dec 2020 12:15:32 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8846D189A5 for ; Wed, 2 Dec 2020 12:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606911344; 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=T2Bqp12Ruqbsz9tAC9rcxRofvUgOvIkYEOwBKcrED60=; b=bytB6+g9ijDnHMsErnckHgiE10gwCFOqsnLrKMDtYiQ7sSfwGs1mGOs/Q4OH+rK7ENxyk0 EfWA+n6ayMZSbNfFYzFizRK/fXYkWmIQFtget/kr2LszhDX/2mbZhAbVTLWT7aUJC92sjx w8zFvhkZIbSzRMKqvczBHbc2JQqXyxw= X-MC-Unique: sECXqWvnN-Gmg0YGcLqZlA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/11] virDomainCheckpointAlignDisks: Use virDomainDiskByName Date: Wed, 2 Dec 2020 13:15:00 +0100 Message-Id: <7b8b0d794a1652b39109773c065c3c97c317d04d.1606911231.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" We don't need the index that virDomainDiskIndexByName returns. Signed-off-by: Peter Krempa --- src/conf/checkpoint_conf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index bd0a673757..089488fbc6 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -315,17 +315,14 @@ virDomainCheckpointAlignDisks(virDomainCheckpointDefP= tr chkdef) /* Double check requested disks. */ for (i =3D 0; i < chkdef->ndisks; i++) { virDomainCheckpointDiskDefPtr chkdisk =3D &chkdef->disks[i]; - int idx =3D virDomainDiskIndexByName(domdef, chkdisk->name, false); - virDomainDiskDefPtr domdisk; + virDomainDiskDefPtr domdisk =3D virDomainDiskByName(domdef, chkdis= k->name, false); - if (idx < 0) { + if (!domdisk) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("no disk named '%s'"), chkdisk->name); return -1; } - domdisk =3D domdef->disks[idx]; - if (virHashHasEntry(map, domdisk->dst)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("disk '%s' specified twice"), --=20 2.28.0