[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/6] block: Drop BlockDriverStat
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/6] block: Drop BlockDriverState.filename |
Date: |
Mon, 31 Aug 2015 15:50:06 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 08/18/2015 05:10 PM, Max Reitz wrote:
> That field is now only used during initialization of BlockDriverStates
> (opening images) and for error or warning messages. Performance is not
> that much of an issue here, so we can drop the field and replace its use
> by a call to bdrv_filename() or bdrv_filename_alloc(). By doing so we
> can ensure the result always to be recent, whereas the contents of
> BlockDriverState.filename may have been obsoleted by manipulations of
> single BlockDriverStates or of the BDS graph.
>
> The users of the BDS filename field were changed as follows:
> - copying the filename into another buffer is trivially replaced by
> using bdrv_filename() instead of the copy function
> - strdup() on the filename is replaced by a call to
> bdrv_filename_alloc()
> - bdrv_filename(bs, bs->filename, sizeof(bs->filename)) is replaced by
> bdrv_refresh_filename(bs)
> (these were introduced by the previous patch)
> - anywhere else bdrv_filename_alloc() is used, any access to
> BlockDriverState.filename is then replaced by the buffer returned, and
> it is freed when it is no longer needed
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
Looks like clean conversions.
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] [Qemu-devel] [PATCH v4 1/6] block: Change bdrv_get_encrypted_filename(), (continued)
- [Qemu-block] [PATCH v4 2/6] block: Avoid BlockDriverState.filename, Max Reitz, 2015/08/18
- [Qemu-block] [PATCH v4 3/6] block: Add bdrv_filename(), Max Reitz, 2015/08/18
- [Qemu-block] [PATCH v4 4/6] qemu-img: Use bdrv_filename_alloc() for map, Max Reitz, 2015/08/18
- [Qemu-block] [PATCH v4 6/6] iotests: Test changed Quorum filename, Max Reitz, 2015/08/18
- [Qemu-block] [PATCH v4 5/6] block: Drop BlockDriverState.filename, Max Reitz, 2015/08/18
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/6] block: Drop BlockDriverState.filename,
Eric Blake <=