From nobody Wed May 14 06:59:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528102796884457.4233547500885; Mon, 4 Jun 2018 01:59:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5247CABB38; Mon, 4 Jun 2018 08:59:55 +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 2230D3083321; Mon, 4 Jun 2018 08:59:55 +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 9541D4CA80; Mon, 4 Jun 2018 08:59:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w548xD5G018709 for ; Mon, 4 Jun 2018 04:59:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0D9BB2026E0E; Mon, 4 Jun 2018 08:59:13 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id A69942026DEF for ; Mon, 4 Jun 2018 08:59:12 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 4 Jun 2018 10:58:52 +0200 Message-Id: <13ef0b57724828cc530fbbecbd3841765df9227b.1528102541.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/10] util: storage: remove 'allow_probe' from virStorageFileGetMetadata 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 04 Jun 2018 08:59:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" All callers pass 'false' now so it's no longer needed. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_domain.c | 4 +--- src/security/virt-aa-helper.c | 2 +- src/util/virstoragefile.c | 18 +++++++----------- src/util/virstoragefile.h | 1 - tests/virstoragetest.c | 2 +- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d230ead359..d4771ff3f7 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8061,9 +8061,7 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, qemuDomainGetImageIds(cfg, vm, src, disk->src, &uid, &gid); - if (virStorageFileGetMetadata(src, - uid, gid, false, - report_broken) < 0) + if (virStorageFileGetMetadata(src, uid, gid, report_broken) < 0) goto cleanup; for (n =3D src; virStorageSourceIsBacking(n); n =3D n->backingStore) { diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 37fe36a329..971ee6733c 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -974,7 +974,7 @@ get_files(vahControl * ctl) * so that the open could be re-tried as that user:group. */ if (!virStorageSourceHasBacking(disk->src)) - virStorageFileGetMetadata(disk->src, -1, -1, false, false); + virStorageFileGetMetadata(disk->src, -1, -1, false); /* XXX passing ignoreOpenFailure =3D true to get back to the behav= ior * from before using virDomainDiskDefForeachPath. actually we shou= ld diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 62768af968..6ede542df6 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -4678,7 +4678,6 @@ static int virStorageFileGetMetadataRecurse(virStorageSourcePtr src, virStorageSourcePtr parent, uid_t uid, gid_t gid, - bool allow_probe, bool report_broken, virHashTablePtr cycle, unsigned int depth) @@ -4691,9 +4690,9 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr = src, int backingFormat; int rv; - VIR_DEBUG("path=3D%s format=3D%d uid=3D%u gid=3D%u probe=3D%d", + VIR_DEBUG("path=3D%s format=3D%d uid=3D%u gid=3D%u", src->path, src->format, - (unsigned int)uid, (unsigned int)gid, allow_probe); + (unsigned int)uid, (unsigned int)gid); /* exit if we can't load information about the current image */ rv =3D virStorageFileSupportsBackingChainTraversal(src); @@ -4740,7 +4739,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr = src, if (!(backingStore =3D virStorageSourceNewFromBacking(src))) goto cleanup; - if (backingFormat =3D=3D VIR_STORAGE_FILE_AUTO && !allow_probe) + if (backingFormat =3D=3D VIR_STORAGE_FILE_AUTO) backingStore->format =3D VIR_STORAGE_FILE_RAW; else if (backingFormat =3D=3D VIR_STORAGE_FILE_AUTO_SAFE) backingStore->format =3D VIR_STORAGE_FILE_AUTO; @@ -4749,7 +4748,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr = src, if ((ret =3D virStorageFileGetMetadataRecurse(backingStore, parent, uid, gid, - allow_probe, report_br= oken, + report_broken, cycle, depth + 1)) < 0= ) { if (report_broken) goto cleanup; @@ -4802,12 +4801,11 @@ virStorageFileGetMetadataRecurse(virStorageSourcePt= r src, int virStorageFileGetMetadata(virStorageSourcePtr src, uid_t uid, gid_t gid, - bool allow_probe, bool report_broken) { - VIR_DEBUG("path=3D%s format=3D%d uid=3D%u gid=3D%u probe=3D%d, report_= broken=3D%d", + VIR_DEBUG("path=3D%s format=3D%d uid=3D%u gid=3D%u report_broken=3D%d", src->path, src->format, (unsigned int)uid, (unsigned int)gid, - allow_probe, report_broken); + report_broken); virHashTablePtr cycle =3D NULL; virStorageType actualType =3D virStorageSourceGetActualType(src); @@ -4819,14 +4817,12 @@ virStorageFileGetMetadata(virStorageSourcePtr src, if (src->format <=3D VIR_STORAGE_FILE_NONE) { if (actualType =3D=3D VIR_STORAGE_TYPE_DIR) src->format =3D VIR_STORAGE_FILE_DIR; - else if (allow_probe) - src->format =3D VIR_STORAGE_FILE_AUTO; else src->format =3D VIR_STORAGE_FILE_RAW; } ret =3D virStorageFileGetMetadataRecurse(src, src, uid, gid, - allow_probe, report_broken, cyc= le, 1); + report_broken, cycle, 1); virHashFree(cycle); return ret; diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 33fc853fcd..592e19bd7f 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -504,7 +504,6 @@ int virStorageFileSupportsAccess(const virStorageSource= *src); int virStorageFileGetMetadata(virStorageSourcePtr src, uid_t uid, gid_t gid, - bool allow_probe, bool report_broken) ATTRIBUTE_NONNULL(1); diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 2236351309..ad92f3b875 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -117,7 +117,7 @@ testStorageFileGetMetadata(const char *path, if (VIR_STRDUP(ret->path, path) < 0) goto error; - if (virStorageFileGetMetadata(ret, uid, gid, false, false) < 0) + if (virStorageFileGetMetadata(ret, uid, gid, false) < 0) goto error; return ret; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list