mirror of https://gitee.com/openkylin/libvirt.git
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e5c8f6e080
commit
35d1f5bd14
|
@ -11894,7 +11894,7 @@ qemuStorageLimitsRefresh(virQEMUDriverPtr driver,
|
|||
if (virStorageSourceUpdateBackingSizes(src, fd, &sb) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virStorageSourceUpdateCapacity(src, buf, len, false) < 0)
|
||||
if (virStorageSourceUpdateCapacity(src, buf, len) < 0)
|
||||
goto cleanup;
|
||||
|
||||
/* If guest is not using raw disk format and is on a host block
|
||||
|
|
|
@ -1756,7 +1756,7 @@ storageBackendUpdateVolTargetInfo(virStorageVolType voltype,
|
|||
}
|
||||
}
|
||||
|
||||
if (virStorageSourceUpdateCapacity(target, buf, len, false) < 0)
|
||||
if (virStorageSourceUpdateCapacity(target, buf, len) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -3964,18 +3964,15 @@ virStorageSourceUpdateBackingSizes(virStorageSourcePtr src,
|
|||
* @src: disk source definition structure
|
||||
* @buf: buffer to 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
|
||||
* @src in order to "see" if we can recognize what exists.
|
||||
* Update the storage @src capacity.
|
||||
*
|
||||
* Returns 0 on success, -1 on error.
|
||||
*/
|
||||
int
|
||||
virStorageSourceUpdateCapacity(virStorageSourcePtr src,
|
||||
char *buf,
|
||||
ssize_t len,
|
||||
bool probe)
|
||||
ssize_t len)
|
||||
{
|
||||
int format = src->format;
|
||||
g_autoptr(virStorageSource) meta = NULL;
|
||||
|
@ -3984,18 +3981,10 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
|
|||
* the metadata has a capacity, use that, otherwise fall back to
|
||||
* physical size. */
|
||||
if (format == VIR_STORAGE_FILE_NONE) {
|
||||
if (!probe) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("no disk format for %s and probing is disabled"),
|
||||
src->path);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((format = virStorageFileProbeFormatFromBuf(src->path,
|
||||
buf, len)) < 0)
|
||||
return -1;
|
||||
|
||||
src->format = format;
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("no disk format for %s was specified"),
|
||||
src->path);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (format == VIR_STORAGE_FILE_RAW && !src->encryption) {
|
||||
|
|
|
@ -472,8 +472,7 @@ int virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
|
|||
int virStorageSourceUpdateBackingSizes(virStorageSourcePtr src,
|
||||
int fd, struct stat const *sb);
|
||||
int virStorageSourceUpdateCapacity(virStorageSourcePtr src,
|
||||
char *buf, ssize_t len,
|
||||
bool probe);
|
||||
char *buf, ssize_t len);
|
||||
|
||||
int virStorageSourceNewFromBacking(virStorageSourcePtr parent,
|
||||
virStorageSourcePtr *backing);
|
||||
|
|
Loading…
Reference in New Issue