From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoHiG-0000Sg-Sl for qemu-devel@nongnu.org; Mon, 19 Oct 2015 17:11:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoHiF-00008C-T0 for qemu-devel@nongnu.org; Mon, 19 Oct 2015 17:11:24 -0400 References: <1445280546-26226-1-git-send-email-mreitz@redhat.com> <1445280546-26226-6-git-send-email-mreitz@redhat.com> From: Eric Blake Message-ID: <56255C73.6070106@redhat.com> Date: Mon, 19 Oct 2015 15:11:15 -0600 MIME-Version: 1.0 In-Reply-To: <1445280546-26226-6-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RLrovaj663J7bbpjT0XpWQxDWVGOciHio" Subject: Re: [Qemu-devel] [PATCH v5 5/6] block: Drop BlockDriverState.filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RLrovaj663J7bbpjT0XpWQxDWVGOciHio Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 us= e > 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. >=20 > 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, an= d > it is freed when it is no longer needed >=20 > Signed-off-by: Max Reitz > --- > 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(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --RLrovaj663J7bbpjT0XpWQxDWVGOciHio Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWJVxzAAoJEKeha0olJ0NqoOQH/15RTHicUn+TAP94lMfeS+2A zUPYq+FOFKaKKQU4gMP5Pbe/fqRb8qLUAN083GvTIuTkvZRrtdmriCh4OVnIKqEu K2HEWlJMtE6nfscUv2IEtLO2LevqLSnKe4BQfEBfGChedXbpzmVJq6kbRYsxPEix Bjrzgwdl9VxJF32+KWm+0F6/+CNd4jpqWnCFIu8d1oAQGmlouIJob3NeEPA/LryD Wd7LIn13RIF5LY2OxtNdv7DjUWxStwsCgLZ2eN1flgWTSeuONlxcSmiWCsdRhyVK lZc3Yn2df48PqMgkIaO4zlQ5wNUXLrk8LyiDhRK2ZqjHp1tbIZ4aPyTKo6tHv+g= =/Dt3 -----END PGP SIGNATURE----- --RLrovaj663J7bbpjT0XpWQxDWVGOciHio--