[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v4 10/25] block: Add bdrv_dirname()
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [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
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH v4 04/25] block: Respect backing bs in bdrv_refresh_filename, (continued)
- [Qemu-block] [PATCH v4 05/25] block: Make path_combine() return the path, Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 06/25] block: bdrv_get_full_backing_filename_from_...'s ret. val., Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 07/25] block: bdrv_get_full_backing_filename's ret. val., Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 08/25] block: Add bdrv_make_absolute_filename(), Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 09/25] block: Fix bdrv_find_backing_image(), Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 10/25] block: Add bdrv_dirname(), Max Reitz, 2017/01/16
- Re: [Qemu-block] [PATCH v4 10/25] block: Add bdrv_dirname(),
Eric Blake <=
- [Qemu-block] [PATCH v4 11/25] blkverify: Make bdrv_dirname() return NULL, Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 12/25] quorum: Make bdrv_dirname() return NULL, Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 13/25] block/nbd: Implement bdrv_dirname(), Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 14/25] block/nfs: Implement bdrv_dirname(), Max Reitz, 2017/01/16
- [Qemu-block] [PATCH v4 15/25] block: Use bdrv_dirname() for relative filenames, Max Reitz, 2017/01/16