From nobody Sun Feb 8 17:22:29 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=1609936029; cv=none; d=zohomail.com; s=zohoarc; b=Wh5FrEMedLRBGgiLRXP30NwXAbfouCncSssgeN6zJzvD3lKQLn+cofacyDi6dBPNiy+OqcqtcLrbtaTeKVlWg1mRQ2OJpkii6c4DYf/1/Dtx4G922ui1fqbNsza+Ci9i10LR+wiTzrAITqTe9/DkgGpOntt6IzZfYMgyYdpzeNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609936029; 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=CgmPnAgSCXY5GVAglqklbx6tzNZ+uO6TxaRQHzikv00=; b=lTbetHJZW1dEkU1uyIdGKGhew76EADRV9aKhtXDVYfGjPzgRsdqzrPKyQGBackYHQiMhhyCrhE632/95IW3Kejzn/2XMHI1xrzEl9/6X2u1Z37D9reYLFSJkckNvGSrFT3O4ye/sFISWjerGjewh0KQO4dDNKsoHWiR42mkocK8= 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 1609936029800393.08518241232184; Wed, 6 Jan 2021 04:27:09 -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-464-Twkl2jEbMxKZ3lhwSH52vA-1; Wed, 06 Jan 2021 07:26:23 -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 A699D107ACF8; Wed, 6 Jan 2021 12:26:17 +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 85AD060BFA; Wed, 6 Jan 2021 12:26:17 +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 4FC8A1809CA4; Wed, 6 Jan 2021 12:26:17 +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 106CQ6Us019017 for ; Wed, 6 Jan 2021 07:26:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 907F260BE5; Wed, 6 Jan 2021 12:26:06 +0000 (UTC) Received: from antique-work.lan (unknown [10.40.194.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D79C60BE2 for ; Wed, 6 Jan 2021 12:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609936028; 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=CgmPnAgSCXY5GVAglqklbx6tzNZ+uO6TxaRQHzikv00=; b=MlZSouQOf9NTmi8EOUqSFAycLiFkoRoEe+eJ84OGjnkciRN6+/AuVmCwbp5M1ibgRpFuP4 bxtrdYZliChBf0M/+v98NExhuci84lmEW/NtGHI8UCdLqjyijveqqCrf1cEx3v4XE2nXPJ PMD78C9alhA1ap6rWuzJJqjZFL8tNpY= X-MC-Unique: Twkl2jEbMxKZ3lhwSH52vA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/9] virstoragefile: remove unused virStorageFileChainCheckBroken Date: Wed, 6 Jan 2021 13:25:53 +0100 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.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" 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 d7714361d3..f8da4a7648 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3127,7 +3127,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.29.2