提交 e1e8d0a9 编写于 作者: P Peter Krempa

util: storage: remove 'allow_probe' from virStorageFileGetMetadata

All callers pass 'false' now so it's no longer needed.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 e0f8839b
...@@ -8118,9 +8118,7 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, ...@@ -8118,9 +8118,7 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
qemuDomainGetImageIds(cfg, vm, src, disk->src, &uid, &gid); qemuDomainGetImageIds(cfg, vm, src, disk->src, &uid, &gid);
if (virStorageFileGetMetadata(src, if (virStorageFileGetMetadata(src, uid, gid, report_broken) < 0)
uid, gid, false,
report_broken) < 0)
goto cleanup; goto cleanup;
for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
......
...@@ -974,7 +974,7 @@ get_files(vahControl * ctl) ...@@ -974,7 +974,7 @@ get_files(vahControl * ctl)
* so that the open could be re-tried as that user:group. * so that the open could be re-tried as that user:group.
*/ */
if (!virStorageSourceHasBacking(disk->src)) 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 /* XXX passing ignoreOpenFailure = true to get back to the behavior
* from before using virDomainDiskDefForeachPath. actually we should * from before using virDomainDiskDefForeachPath. actually we should
......
...@@ -4678,7 +4678,6 @@ static int ...@@ -4678,7 +4678,6 @@ static int
virStorageFileGetMetadataRecurse(virStorageSourcePtr src, virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
virStorageSourcePtr parent, virStorageSourcePtr parent,
uid_t uid, gid_t gid, uid_t uid, gid_t gid,
bool allow_probe,
bool report_broken, bool report_broken,
virHashTablePtr cycle, virHashTablePtr cycle,
unsigned int depth) unsigned int depth)
...@@ -4691,9 +4690,9 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src, ...@@ -4691,9 +4690,9 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
int backingFormat; int backingFormat;
int rv; 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, 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 */ /* exit if we can't load information about the current image */
rv = virStorageFileSupportsBackingChainTraversal(src); rv = virStorageFileSupportsBackingChainTraversal(src);
...@@ -4740,7 +4739,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src, ...@@ -4740,7 +4739,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
if (!(backingStore = virStorageSourceNewFromBacking(src))) if (!(backingStore = virStorageSourceNewFromBacking(src)))
goto cleanup; goto cleanup;
if (backingFormat == VIR_STORAGE_FILE_AUTO && !allow_probe) if (backingFormat == VIR_STORAGE_FILE_AUTO)
backingStore->format = VIR_STORAGE_FILE_RAW; backingStore->format = VIR_STORAGE_FILE_RAW;
else if (backingFormat == VIR_STORAGE_FILE_AUTO_SAFE) else if (backingFormat == VIR_STORAGE_FILE_AUTO_SAFE)
backingStore->format = VIR_STORAGE_FILE_AUTO; backingStore->format = VIR_STORAGE_FILE_AUTO;
...@@ -4749,7 +4748,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src, ...@@ -4749,7 +4748,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
if ((ret = virStorageFileGetMetadataRecurse(backingStore, parent, if ((ret = virStorageFileGetMetadataRecurse(backingStore, parent,
uid, gid, uid, gid,
allow_probe, report_broken, report_broken,
cycle, depth + 1)) < 0) { cycle, depth + 1)) < 0) {
if (report_broken) if (report_broken)
goto cleanup; goto cleanup;
...@@ -4802,12 +4801,11 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src, ...@@ -4802,12 +4801,11 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
int int
virStorageFileGetMetadata(virStorageSourcePtr src, virStorageFileGetMetadata(virStorageSourcePtr src,
uid_t uid, gid_t gid, uid_t uid, gid_t gid,
bool allow_probe,
bool report_broken) 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, src->path, src->format, (unsigned int)uid, (unsigned int)gid,
allow_probe, report_broken); report_broken);
virHashTablePtr cycle = NULL; virHashTablePtr cycle = NULL;
virStorageType actualType = virStorageSourceGetActualType(src); virStorageType actualType = virStorageSourceGetActualType(src);
...@@ -4819,14 +4817,12 @@ virStorageFileGetMetadata(virStorageSourcePtr src, ...@@ -4819,14 +4817,12 @@ virStorageFileGetMetadata(virStorageSourcePtr src,
if (src->format <= VIR_STORAGE_FILE_NONE) { if (src->format <= VIR_STORAGE_FILE_NONE) {
if (actualType == VIR_STORAGE_TYPE_DIR) if (actualType == VIR_STORAGE_TYPE_DIR)
src->format = VIR_STORAGE_FILE_DIR; src->format = VIR_STORAGE_FILE_DIR;
else if (allow_probe)
src->format = VIR_STORAGE_FILE_AUTO;
else else
src->format = VIR_STORAGE_FILE_RAW; src->format = VIR_STORAGE_FILE_RAW;
} }
ret = virStorageFileGetMetadataRecurse(src, src, uid, gid, ret = virStorageFileGetMetadataRecurse(src, src, uid, gid,
allow_probe, report_broken, cycle, 1); report_broken, cycle, 1);
virHashFree(cycle); virHashFree(cycle);
return ret; return ret;
......
...@@ -504,7 +504,6 @@ int virStorageFileSupportsAccess(const virStorageSource *src); ...@@ -504,7 +504,6 @@ int virStorageFileSupportsAccess(const virStorageSource *src);
int virStorageFileGetMetadata(virStorageSourcePtr src, int virStorageFileGetMetadata(virStorageSourcePtr src,
uid_t uid, gid_t gid, uid_t uid, gid_t gid,
bool allow_probe,
bool report_broken) bool report_broken)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
......
...@@ -117,7 +117,7 @@ testStorageFileGetMetadata(const char *path, ...@@ -117,7 +117,7 @@ testStorageFileGetMetadata(const char *path,
if (VIR_STRDUP(ret->path, path) < 0) if (VIR_STRDUP(ret->path, path) < 0)
goto error; goto error;
if (virStorageFileGetMetadata(ret, uid, gid, false, false) < 0) if (virStorageFileGetMetadata(ret, uid, gid, false) < 0)
goto error; goto error;
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册