From nobody Mon Nov 25 16:25:30 2024 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=1600868104; cv=none; d=zohomail.com; s=zohoarc; b=iT1zsBxujr0pZ4KrLhqp5vUGOG2A7JrdcH1s7+5TIGvitROQTIjYoICQHuzfc/Y6KjkPx40ZJVkGjdYMFBhnJxE0/JQosOL7dHNpgGoLRAEkw9yz+l3VhzDycc1uFNN0Or4vo9UONDBDXDmku6c1UgD5lvOjtlqcTd9K30wXl80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600868104; 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=2qLnHEVJlb1ybsoLy3FPVEzwWrk979qMsoaN58p4L0I=; b=QsD5guenbxq8whP+RKl89/DdjRUbZ/h5rLOx5E0joeUrestrfXKqAk+mtgsqKfstNOi4wct2lJPK5BEC5l3H2qAoA2WIfCDhrycobO2zkasg9BFMkirF0PB9E23Sb9AxtZf0htRTZGaPMDh6d7hnbPtS1FFT2EsSG/i1nmWpNZo= 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1600868104478420.4409246922602; Wed, 23 Sep 2020 06:35:04 -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-317-cdSrVZZbN5qKlIvrpd2KTg-1; Wed, 23 Sep 2020 09:34:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 368D010BBED1; Wed, 23 Sep 2020 13:34:04 +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 1056819C4F; Wed, 23 Sep 2020 13:34:04 +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 CEA10183D047; Wed, 23 Sep 2020 13:34:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NDXvcB013917 for ; Wed, 23 Sep 2020 09:33:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7807A10023A7; Wed, 23 Sep 2020 13:33:57 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id D70E7100239F for ; Wed, 23 Sep 2020 13:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600868103; 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=2qLnHEVJlb1ybsoLy3FPVEzwWrk979qMsoaN58p4L0I=; b=NZnRga1k5A9regrW+eo7bH4zVg1erQtYtTRHFLcAxY8JKX07w9lPF1VCFE6RwesyvPBTBM OLPagTHMSrIh2DioBgV5FdQqjZcOhiWN3K0RQCDUb1e6sQvHIt2efM6oKJB4Rg95QIGFxz P88G8fNlhTW3JrbkKOmiuOq1LBLqTbI= X-MC-Unique: cdSrVZZbN5qKlIvrpd2KTg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/13] virDomainSnapshotAlignDisks: Rename 'disk' -> 'snapdisk' Date: Wed, 23 Sep 2020 15:33:38 +0200 Message-Id: <9261fa0c70dabf00563132984ec5b3189951e336.1600867955.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.23 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" The 'disk' variable usually refers to a definition of a disk from the domain definition. Rename it to 'snapdisk' to be clear that we are talking about the snapshot disk definition especially since this function also accesses the domain disk definition. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/snapshot_conf.c | 54 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 77f53c4a1d..c835ec7333 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -674,56 +674,56 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr s= napdef, /* Double check requested disks. */ for (i =3D 0; i < snapdef->ndisks; i++) { - virDomainSnapshotDiskDefPtr disk =3D &snapdef->disks[i]; - int idx =3D virDomainDiskIndexByName(snapdef->parent.dom, disk->na= me, false); + virDomainSnapshotDiskDefPtr snapdisk =3D &snapdef->disks[i]; + int idx =3D virDomainDiskIndexByName(snapdef->parent.dom, snapdisk= ->name, false); int disk_snapshot; if (idx < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("no disk named '%s'"), disk->name); + _("no disk named '%s'"), snapdisk->name); return -1; } if (virBitmapIsBitSet(map, idx)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("disk '%s' specified twice"), - disk->name); + snapdisk->name); return -1; } ignore_value(virBitmapSetBit(map, idx)); - disk->idx =3D idx; + snapdisk->idx =3D idx; disk_snapshot =3D snapdef->parent.dom->disks[idx]->snapshot; - if (!disk->snapshot) { + if (!snapdisk->snapshot) { if (disk_snapshot && (!require_match || disk_snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)) - disk->snapshot =3D disk_snapshot; + snapdisk->snapshot =3D disk_snapshot; else - disk->snapshot =3D default_snapshot; + snapdisk->snapshot =3D default_snapshot; } else if (require_match && - disk->snapshot !=3D default_snapshot && - !(disk->snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_NO= NE && + snapdisk->snapshot !=3D default_snapshot && + !(snapdisk->snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATIO= N_NONE && disk_snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_NON= E)) { const char *tmp; tmp =3D virDomainSnapshotLocationTypeToString(default_snapshot= ); virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("disk '%s' must use snapshot mode '%s'"), - disk->name, tmp); + snapdisk->name, tmp); return -1; } - if (disk->src->path && - disk->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) { + if (snapdisk->src->path && + snapdisk->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)= { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("file '%s' for disk '%s' requires " "use of external snapshot mode"), - disk->src->path, disk->name); + snapdisk->src->path, snapdisk->name); return -1; } - if (STRNEQ(disk->name, snapdef->parent.dom->disks[idx]->dst)) { - VIR_FREE(disk->name); - disk->name =3D g_strdup(snapdef->parent.dom->disks[idx]->dst); + if (STRNEQ(snapdisk->name, snapdef->parent.dom->disks[idx]->dst)) { + VIR_FREE(snapdisk->name); + snapdisk->name =3D g_strdup(snapdef->parent.dom->disks[idx]->d= st); } } @@ -734,24 +734,24 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr s= napdef, return -1; for (i =3D 0; i < snapdef->parent.dom->ndisks; i++) { - virDomainSnapshotDiskDefPtr disk; + virDomainSnapshotDiskDefPtr snapdisk; if (virBitmapIsBitSet(map, i)) continue; - disk =3D &snapdef->disks[ndisks++]; - disk->src =3D virStorageSourceNew(); - disk->name =3D g_strdup(snapdef->parent.dom->disks[i]->dst); - disk->idx =3D i; + snapdisk =3D &snapdef->disks[ndisks++]; + snapdisk->src =3D virStorageSourceNew(); + snapdisk->name =3D g_strdup(snapdef->parent.dom->disks[i]->dst); + snapdisk->idx =3D i; /* Don't snapshot empty drives */ if (virStorageSourceIsEmpty(snapdef->parent.dom->disks[i]->src)) - disk->snapshot =3D VIR_DOMAIN_SNAPSHOT_LOCATION_NONE; + snapdisk->snapshot =3D VIR_DOMAIN_SNAPSHOT_LOCATION_NONE; else - disk->snapshot =3D snapdef->parent.dom->disks[i]->snapshot; + snapdisk->snapshot =3D snapdef->parent.dom->disks[i]->snapshot; - disk->src->type =3D VIR_STORAGE_TYPE_FILE; - if (!disk->snapshot) - disk->snapshot =3D default_snapshot; + snapdisk->src->type =3D VIR_STORAGE_TYPE_FILE; + if (!snapdisk->snapshot) + snapdisk->snapshot =3D default_snapshot; } qsort(&snapdef->disks[0], snapdef->ndisks, sizeof(snapdef->disks[0]), --=20 2.26.2