qemu-devel
[Top][All Lists]
Advanced

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

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


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v4 10/25] block: Add bdrv_dirname()
Date: Mon, 16 Jan 2017 17:02:39 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

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?

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

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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