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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]