[libvirt] [PATCH 2/4] util: storage: Allow specifying format for virStorageFileGetMetadataFromBuf

Eric Blake eblake at redhat.com
Mon Jul 7 20:57:44 UTC 2014


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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140707/a47f4702/attachment-0001.sig>


More information about the libvir-list mailing list