qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v4 10/25] block: Add bdrv_dirname()


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v4 10/25] block: Add bdrv_dirname()
Date: Wed, 18 Jan 2017 14:33:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

On 17.01.2017 00:02, Eric Blake wrote:
> On 01/16/2017 02:49 PM, Max Reitz wrote:
>> This function may be implemented by block drivers to derive a directory
>> name from a BDS. Concatenating this g_free()-able string with a relative
>> filename must result in a valid (not necessarily existing) filename, so
>> this is a function that should generally be not implemented by format
>> drivers, because this is protocol-specific.
>>
>> If a BDS's driver does not implement this function, bdrv_dirname() will
>> fall through to the BDS's file if it exists. If it does not, the
>> exact_filename field will be used to generate a directory name.
>>
>> Signed-off-by: Max Reitz <address@hidden>
>> ---
>>  include/block/block.h     |  1 +
>>  include/block/block_int.h |  1 +
>>  block.c                   | 26 ++++++++++++++++++++++++++
>>  3 files changed, 28 insertions(+)
> 
>> +++ b/include/block/block_int.h
>> @@ -130,6 +130,7 @@ struct BlockDriver {
>>      int (*bdrv_make_empty)(BlockDriverState *bs);
>>  
>>      void (*bdrv_refresh_filename)(BlockDriverState *bs, QDict *options);
>> +    char *(*bdrv_dirname)(BlockDriverState *bs, Error **errp);
> 
> I know we've been lousy at documentation in the past, but should we
> start doing a better job of documenting the contract as we add new
> callbacks, rather than just the commit messages?

Good point, I'll add a comment.

> Based on existing practice, though, I'm okay with:
> Reviewed-by: Eric Blake <address@hidden>

Thanks for reviewing!

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]