On 10/19/2015 12:49 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(). 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(filename, NULL, 0) > - bdrv_filename(bs, bs->filename, sizeof(bs->filename)) is replaced by > bdrv_refresh_filename(bs) > (these were introduced by the patch before the previous patch) > - anywhere else bdrv_filename(..., NULL, 0) 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 <mre...@redhat.com> > --- > block.c | 46 ++++++++++++++++++++++++++++++---------------- > block/blkverify.c | 3 +-- > block/commit.c | 4 +++- > block/mirror.c | 16 ++++++++++++---- > block/qapi.c | 4 ++-- > block/quorum.c | 3 +-- > block/raw_bsd.c | 4 +++- > block/vhdx-log.c | 5 ++++- > block/vmdk.c | 22 ++++++++++++++++------ > block/vpc.c | 7 +++++-- > blockdev.c | 25 +++++++++++++++++++------ > include/block/block_int.h | 1 - > 12 files changed, 96 insertions(+), 44 deletions(-) >
Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature