From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoHPl-0005t5-DW for qemu-devel@nongnu.org; Mon, 19 Oct 2015 16:52:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoHPk-0004DN-5M for qemu-devel@nongnu.org; Mon, 19 Oct 2015 16:52:17 -0400 References: <1445280546-26226-1-git-send-email-mreitz@redhat.com> <1445280546-26226-4-git-send-email-mreitz@redhat.com> From: Eric Blake Message-ID: <562557F4.3030900@redhat.com> Date: Mon, 19 Oct 2015 14:52:04 -0600 MIME-Version: 1.0 In-Reply-To: <1445280546-26226-4-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XhAWtrf8dRQTxokjXbpIFPk6mGPlr5576" Subject: Re: [Qemu-devel] [PATCH v5 3/6] block: Add bdrv_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) --XhAWtrf8dRQTxokjXbpIFPk6mGPlr5576 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > 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). >=20 > Signed-off-by: Max Reitz > --- > block.c | 43 ++++++++++++++++++++++++++++++++++++-------= > block/blkverify.c | 3 ++- > block/quorum.c | 3 ++- > include/block/block.h | 1 + > 4 files changed, 41 insertions(+), 9 deletions(-) >=20 > + > +/* First refreshes exact_filename and full_open_options by calling > + * bdrv_refresh_filename(). Then, if exact_filename is set, it is copi= ed into > + * the target buffer. Otherwise, full_open_options is converted to a J= SON > + * object, prefixed with "json:" (for use through the JSON pseudo prot= ocol) and > + * put there. > + * > + * If @sz > 0, the string put into the buffer will always be null-term= inated. Maybe add a warning: =2E..always be null-terminated, even if this truncates the result. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --XhAWtrf8dRQTxokjXbpIFPk6mGPlr5576 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/ iQEcBAEBCAAGBQJWJVf0AAoJEKeha0olJ0Nq/jIIAIN+nbzui50+YiO2XFeuPgIq Yi6VlSbYNgZrZIjHQzJwk9F3zXh1HqamHZi0zD+twGggOF3c0IaLCIZnGwfQhB8K XvUaSPzjnRwjQAdljaUBf34mMJ3bPfRVM0IRWYkBTVZ/dcVF57sfjr4sOcpJ5yZM SLHLvcRGyaWZDa3/9+MxW1bRTulhaG/sT+QMpN3Fgw0dEX0mZAjydBMzulWnEVYc VJIl1Sz6Id9D0e2E2I8KXMPTpdRRx2Rb3KfP63GmzDIi9ID9AACLJZWZDSmojMND +BBCQ2qXbVr5LLKbr1x4LUHtRi5eeXUf8Y5bvM3F/GS9CoCjautSDisSGKr1aSY= =Faa8 -----END PGP SIGNATURE----- --XhAWtrf8dRQTxokjXbpIFPk6mGPlr5576--