mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
util: storage: remove 'allow_probe' from virStorageFileGetMetadata
All callers pass 'false' now so it's no longer needed. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e0f8839b88
commit
e1e8d0a9b7
@ -8118,9 +8118,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 = src; virStorageSourceIsBacking(n); n = n->backingStore) {
|
||||
|
@ -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 = true to get back to the behavior
|
||||
* from before using virDomainDiskDefForeachPath. actually we should
|
||||
|
@ -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=%s format=%d uid=%u gid=%u probe=%d",
|
||||
VIR_DEBUG("path=%s format=%d uid=%u gid=%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 = virStorageFileSupportsBackingChainTraversal(src);
|
||||
@ -4740,7 +4739,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
|
||||
if (!(backingStore = virStorageSourceNewFromBacking(src)))
|
||||
goto cleanup;
|
||||
|
||||
if (backingFormat == VIR_STORAGE_FILE_AUTO && !allow_probe)
|
||||
if (backingFormat == VIR_STORAGE_FILE_AUTO)
|
||||
backingStore->format = VIR_STORAGE_FILE_RAW;
|
||||
else if (backingFormat == VIR_STORAGE_FILE_AUTO_SAFE)
|
||||
backingStore->format = VIR_STORAGE_FILE_AUTO;
|
||||
@ -4749,7 +4748,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
|
||||
|
||||
if ((ret = virStorageFileGetMetadataRecurse(backingStore, parent,
|
||||
uid, gid,
|
||||
allow_probe, report_broken,
|
||||
report_broken,
|
||||
cycle, depth + 1)) < 0) {
|
||||
if (report_broken)
|
||||
goto cleanup;
|
||||
@ -4802,12 +4801,11 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
|
||||
int
|
||||
virStorageFileGetMetadata(virStorageSourcePtr src,
|
||||
uid_t uid, gid_t gid,
|
||||
bool allow_probe,
|
||||
bool report_broken)
|
||||
{
|
||||
VIR_DEBUG("path=%s format=%d uid=%u gid=%u probe=%d, report_broken=%d",
|
||||
VIR_DEBUG("path=%s format=%d uid=%u gid=%u report_broken=%d",
|
||||
src->path, src->format, (unsigned int)uid, (unsigned int)gid,
|
||||
allow_probe, report_broken);
|
||||
report_broken);
|
||||
|
||||
virHashTablePtr cycle = NULL;
|
||||
virStorageType actualType = virStorageSourceGetActualType(src);
|
||||
@ -4819,14 +4817,12 @@ virStorageFileGetMetadata(virStorageSourcePtr src,
|
||||
if (src->format <= VIR_STORAGE_FILE_NONE) {
|
||||
if (actualType == VIR_STORAGE_TYPE_DIR)
|
||||
src->format = VIR_STORAGE_FILE_DIR;
|
||||
else if (allow_probe)
|
||||
src->format = VIR_STORAGE_FILE_AUTO;
|
||||
else
|
||||
src->format = VIR_STORAGE_FILE_RAW;
|
||||
}
|
||||
|
||||
ret = virStorageFileGetMetadataRecurse(src, src, uid, gid,
|
||||
allow_probe, report_broken, cycle, 1);
|
||||
report_broken, cycle, 1);
|
||||
|
||||
virHashFree(cycle);
|
||||
return ret;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user