[libvirt] [PATCH 2/4] util: storage: Allow specifying format for virStorageFileGetMetadataFromBuf
Peter Krempa
pkrempa at redhat.com
Tue Jul 8 09:39:41 UTC 2014
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140708/14f729f7/attachment-0001.sig>
More information about the libvir-list
mailing list