From nobody Sun Feb 8 11:21:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1607961381; cv=none; d=zohomail.com; s=zohoarc; b=HznjdpH+xXtAhOMWF3NwcGvi/ckZtFxUTBC8QObPMgwRMOL8R6uBhZsPH3Q00QWwkwAcoET1bqVIOGkglY8VSzQfvvbw1vpAosstmmbY5KmnbiEO445mV+68kBUtilLUUEYS4svBB/OZUAyZrZtftLLb1BM6jiuQ6RYhP55KSVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607961381; 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=OX0M3r8uUOSsfxrSejV2zdkfhgYx/jslB7OwP4gZ6pU=; b=iey7g6ssicfTowKma+Vpt1TcqpiK6X/UbKpsP9GKy0r5dbe4+G+W2gOt8dULMd539ZfODbk2OGjrsAM0KjQTXk9Q2BWCzmSFIcd1rfmaCNvaPXb19YJrl1TtwtFd0qiOig+RflZll3Dvf5Oy+21g0q2ziENqF2x39fsR9bqrdCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607961380979571.117492124453; Mon, 14 Dec 2020 07:56:20 -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-5-EgqzLOluONyyuaIFfMugOw-1; Mon, 14 Dec 2020 10:56:14 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF3848015F5; Mon, 14 Dec 2020 15:56:07 +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 A5F5E5D6D5; Mon, 14 Dec 2020 15:56:07 +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 6CF705002F; Mon, 14 Dec 2020 15:56:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BEFtjoD028505 for ; Mon, 14 Dec 2020 10:55:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1D31D5D6D5; Mon, 14 Dec 2020 15:55:45 +0000 (UTC) Received: from antique-work.lan (unknown [10.40.194.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D1E162467 for ; Mon, 14 Dec 2020 15:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607961377; 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=OX0M3r8uUOSsfxrSejV2zdkfhgYx/jslB7OwP4gZ6pU=; b=AVgye1bG9bBKA8ySrJGWbH8f/MUiqSIDtNLp/XoDzrzTdHDbgyHdZYEpAj5inwFwLlZ5s3 W8jWl8iQeq5OjEJ+Nk9KkrcXHCA855WIZorlB0sciZa9xNXVLSmdTiIj2jfVz9n4v5mv9E Wmg2aT84jYvgEbTEwuIPTLN3Oltpaqo= X-MC-Unique: EgqzLOluONyyuaIFfMugOw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 02/17] virstoragefile: remove unused virStorageFileChainCheckBroken Date: Mon, 14 Dec 2020 16:55:22 +0100 Message-Id: <74705fad75ce31cf5dcf513600e609d5e14a75c7.1607960951.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.15 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 last usage outside of tests was removed by commit <780f8c94ca8b3dee7eb59c1bfbc32f672f965df8>. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/virstoragefile.c | 33 --------------------------------- src/util/virstoragefile.h | 3 --- tests/virstoragetest.c | 6 ------ 4 files changed, 43 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 8e1d101a97..8f55ba515c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3126,7 +3126,6 @@ virStorageAuthDefFree; virStorageAuthDefParse; virStorageFileAccess; virStorageFileCanonicalizePath; -virStorageFileChainGetBroken; virStorageFileChainLookup; virStorageFileChown; virStorageFileCreate; diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index fac93118fd..119342d296 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1193,39 +1193,6 @@ virStorageFileGetMetadataFromFD(const char *path, } =20 =20 -/** - * virStorageFileChainCheckBroken - * - * If CHAIN is broken, set *brokenFile to the broken file name, - * otherwise set it to NULL. Caller MUST free *brokenFile after use. - * Return 0 on success (including when brokenFile is set), negative on - * error (allocation failure). - */ -int -virStorageFileChainGetBroken(virStorageSourcePtr chain, - char **brokenFile) -{ - virStorageSourcePtr tmp; - - *brokenFile =3D NULL; - - if (!chain) - return 0; - - for (tmp =3D chain; virStorageSourceIsBacking(tmp); tmp =3D tmp->backi= ngStore) { - /* Break when we hit end of chain; report error if we detected - * a missing backing file, infinite loop, or other error */ - if (!tmp->backingStore && tmp->backingStoreRaw) { - *brokenFile =3D g_strdup(tmp->backingStoreRaw); - - return 0; - } - } - - return 0; -} - - /** * virStorageFileResize: * diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 87763cf389..cc9bd4875f 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -403,9 +403,6 @@ virStorageSourcePtr virStorageFileGetMetadataFromBuf(co= nst char *path, size_t len, int format) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virStorageFileChainGetBroken(virStorageSourcePtr chain, - char **broken_file); - int virStorageFileParseChainIndex(const char *diskTarget, const char *name, unsigned int *chainIndex) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 2e466ecb99..a376154def 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -270,7 +270,6 @@ testStorageChain(const void *args) virStorageSourcePtr elt; size_t i =3D 0; g_autoptr(virStorageSource) meta =3D NULL; - g_autofree char *broken =3D NULL; =20 meta =3D testStorageFileGetMetadata(data->start, data->format, -1, -1); if (!meta) { @@ -289,11 +288,6 @@ testStorageChain(const void *args) return -1; } =20 - if (virStorageFileChainGetBroken(meta, &broken) || broken) { - fprintf(stderr, "chain should not be identified as broken\n"); - return -1; - } - elt =3D meta; while (virStorageSourceIsBacking(elt)) { g_autofree char *expect =3D NULL; --=20 2.28.0