提交 35d1f5bd 编写于 作者: P Peter Krempa

virStorageSourceUpdateCapacity: Drop 'probe' argument

Both callers pass false. Since we frown upon format probing, remove the
unused possibility to do the probing.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 e5c8f6e0
...@@ -11894,7 +11894,7 @@ qemuStorageLimitsRefresh(virQEMUDriverPtr driver, ...@@ -11894,7 +11894,7 @@ qemuStorageLimitsRefresh(virQEMUDriverPtr driver,
if (virStorageSourceUpdateBackingSizes(src, fd, &sb) < 0) if (virStorageSourceUpdateBackingSizes(src, fd, &sb) < 0)
goto cleanup; goto cleanup;
if (virStorageSourceUpdateCapacity(src, buf, len, false) < 0) if (virStorageSourceUpdateCapacity(src, buf, len) < 0)
goto cleanup; goto cleanup;
/* If guest is not using raw disk format and is on a host block /* If guest is not using raw disk format and is on a host block
......
...@@ -1756,7 +1756,7 @@ storageBackendUpdateVolTargetInfo(virStorageVolType voltype, ...@@ -1756,7 +1756,7 @@ storageBackendUpdateVolTargetInfo(virStorageVolType voltype,
} }
} }
if (virStorageSourceUpdateCapacity(target, buf, len, false) < 0) if (virStorageSourceUpdateCapacity(target, buf, len) < 0)
return -1; return -1;
} }
......
...@@ -3964,18 +3964,15 @@ virStorageSourceUpdateBackingSizes(virStorageSourcePtr src, ...@@ -3964,18 +3964,15 @@ virStorageSourceUpdateBackingSizes(virStorageSourcePtr src,
* @src: disk source definition structure * @src: disk source definition structure
* @buf: buffer to the storage file header * @buf: buffer to the storage file header
* @len: length of the storage file header * @len: length of the storage file header
* @probe: allow probe
* *
* Update the storage @src capacity. This may involve probing the storage * Update the storage @src capacity.
* @src in order to "see" if we can recognize what exists.
* *
* Returns 0 on success, -1 on error. * Returns 0 on success, -1 on error.
*/ */
int int
virStorageSourceUpdateCapacity(virStorageSourcePtr src, virStorageSourceUpdateCapacity(virStorageSourcePtr src,
char *buf, char *buf,
ssize_t len, ssize_t len)
bool probe)
{ {
int format = src->format; int format = src->format;
g_autoptr(virStorageSource) meta = NULL; g_autoptr(virStorageSource) meta = NULL;
...@@ -3984,18 +3981,10 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src, ...@@ -3984,18 +3981,10 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
* the metadata has a capacity, use that, otherwise fall back to * the metadata has a capacity, use that, otherwise fall back to
* physical size. */ * physical size. */
if (format == VIR_STORAGE_FILE_NONE) { if (format == VIR_STORAGE_FILE_NONE) {
if (!probe) { virReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR, _("no disk format for %s was specified"),
_("no disk format for %s and probing is disabled"), src->path);
src->path); return -1;
return -1;
}
if ((format = virStorageFileProbeFormatFromBuf(src->path,
buf, len)) < 0)
return -1;
src->format = format;
} }
if (format == VIR_STORAGE_FILE_RAW && !src->encryption) { if (format == VIR_STORAGE_FILE_RAW && !src->encryption) {
......
...@@ -472,8 +472,7 @@ int virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src, ...@@ -472,8 +472,7 @@ int virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
int virStorageSourceUpdateBackingSizes(virStorageSourcePtr src, int virStorageSourceUpdateBackingSizes(virStorageSourcePtr src,
int fd, struct stat const *sb); int fd, struct stat const *sb);
int virStorageSourceUpdateCapacity(virStorageSourcePtr src, int virStorageSourceUpdateCapacity(virStorageSourcePtr src,
char *buf, ssize_t len, char *buf, ssize_t len);
bool probe);
int virStorageSourceNewFromBacking(virStorageSourcePtr parent, int virStorageSourceNewFromBacking(virStorageSourcePtr parent,
virStorageSourcePtr *backing); virStorageSourcePtr *backing);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册