On 07/07/14 22:57, Eric Blake wrote:
On 07/07/2014 06:16 AM, Peter Krempa wrote:
> To allow reusing this function in the qemu driver we need to allow to
> specify the storage format. Also separate return of the backing store
s/to specify/specifying/
> path now isn't necessary.
> ---
> src/storage/storage_backend_gluster.c | 5 ++++-
> src/util/virstoragefile.c | 31 ++++++++++++++-----------------
> src/util/virstoragefile.h | 2 +-
> 3 files changed, 19 insertions(+), 19 deletions(-)
>
> +++ b/src/storage/storage_backend_gluster.c
> @@ -294,10 +294,13 @@
virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
> goto cleanup;
>
> if (!(meta = virStorageFileGetMetadataFromBuf(name, header, len,
> - &vol->backingStore.path,
> + VIR_STORAGE_FILE_AUTO,
>
&vol->backingStore.format)))
> +++ b/src/util/virstoragefile.c
> + *
> + * Callers are advised never to use VIR_STORAGE_FILE_AUTO as a
> + * format, since a malicious guest can turn a raw file into any
> * other non-raw format at will.
At this point, we may want to re-phrase this, as this very patch
introduced a caller that passes AUTO. Maybe:
Callers are advised never to use VIR_STORAGE_FILE_AUTO as a format on a
file that might be raw if that file will then be passed to a guest,
since a malicious guest ...
ACK. I'll leave it up to you whether to reword the comment, or if you
can come up with anything better.
I went with your wording as it's better than we have now and pushed the
series.
Thanks.
Peter