qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v5 5/6] block: Drop BlockDriverState.filename
Date: Mon, 19 Oct 2015 15:11:15 -0600	[thread overview]
Message-ID: <56255C73.6070106@redhat.com> (raw)
In-Reply-To: <1445280546-26226-6-git-send-email-mreitz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2007 bytes --]

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 <mreitz@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 <eblake@redhat.com>

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-10-19 21:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 18:49 [Qemu-devel] [PATCH v5 0/6] block: Drop BDS.filename Max Reitz
2015-10-19 18:49 ` [Qemu-devel] [PATCH v5 1/6] block: Change bdrv_get_encrypted_filename() Max Reitz
2015-10-19 20:15   ` Eric Blake
2015-10-26 18:20   ` Kevin Wolf
2015-10-19 18:49 ` [Qemu-devel] [PATCH v5 2/6] block: Avoid BlockDriverState.filename Max Reitz
2015-10-19 20:35   ` Eric Blake
2015-10-26 16:51   ` Kevin Wolf
2015-10-19 18:49 ` [Qemu-devel] [PATCH v5 3/6] block: Add bdrv_filename() Max Reitz
2015-10-19 20:52   ` Eric Blake
2015-10-26 18:20   ` Kevin Wolf
2015-10-19 18:49 ` [Qemu-devel] [PATCH v5 4/6] qemu-img: Use bdrv_filename() for map Max Reitz
2015-10-19 21:02   ` Eric Blake
2015-10-26 18:21   ` Kevin Wolf
2015-10-19 18:49 ` [Qemu-devel] [PATCH v5 5/6] block: Drop BlockDriverState.filename Max Reitz
2015-10-19 21:11   ` Eric Blake [this message]
2015-10-27  9:39   ` Kevin Wolf
2015-10-19 18:49 ` [Qemu-devel] [PATCH v5 6/6] iotests: Test changed Quorum filename Max Reitz
2015-10-19 21:13   ` Eric Blake
2015-10-27  9:41   ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56255C73.6070106@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).