[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 3/6] block: Add bdrv_filename()
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v5 3/6] block: Add bdrv_filename() |
Date: |
Mon, 19 Oct 2015 14:52:04 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/19/2015 12:49 PM, Max Reitz wrote:
> Split the part which actually refreshes the BlockDriverState.filename
> field off of bdrv_refresh_filename() into a more generic function
> bdrv_filename(), which first calls bdrv_refresh_filename() and then
> stores a qemu-usable filename in the given buffer instead of
> BlockDriverState.filename.
>
> Since bdrv_refresh_filename() therefore no longer refreshes that field,
> some calls to that function have to be replaced by calls to
> bdrv_filename() "manually" refreshing the BDS filename field (this is
> only temporary).
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block.c | 43 ++++++++++++++++++++++++++++++++++++-------
> block/blkverify.c | 3 ++-
> block/quorum.c | 3 ++-
> include/block/block.h | 1 +
> 4 files changed, 41 insertions(+), 9 deletions(-)
>
> +
> +/* First refreshes exact_filename and full_open_options by calling
> + * bdrv_refresh_filename(). Then, if exact_filename is set, it is copied into
> + * the target buffer. Otherwise, full_open_options is converted to a JSON
> + * object, prefixed with "json:" (for use through the JSON pseudo protocol)
> and
> + * put there.
> + *
> + * If @sz > 0, the string put into the buffer will always be null-terminated.
Maybe add a warning:
...always be null-terminated, even if this truncates the result.
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
- [Qemu-devel] [PATCH v5 0/6] block: Drop BDS.filename, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v5 1/6] block: Change bdrv_get_encrypted_filename(), Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v5 2/6] block: Avoid BlockDriverState.filename, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v5 3/6] block: Add bdrv_filename(), Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v5 4/6] qemu-img: Use bdrv_filename() for map, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v5 6/6] iotests: Test changed Quorum filename, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v5 5/6] block: Drop BlockDriverState.filename, Max Reitz, 2015/10/19