From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtMEc-0001gG-OW for qemu-devel@nongnu.org; Tue, 25 Nov 2014 14:57:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtMEY-0007sv-2D for qemu-devel@nongnu.org; Tue, 25 Nov 2014 14:57:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtMEX-0007sk-Qc for qemu-devel@nongnu.org; Tue, 25 Nov 2014 14:57:09 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAPJv8ip018336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 25 Nov 2014 14:57:08 -0500 Message-ID: <5474DF13.4020202@redhat.com> Date: Tue, 25 Nov 2014 12:57:07 -0700 From: Eric Blake MIME-Version: 1.0 References: <1416822200-31088-1-git-send-email-mreitz@redhat.com> <1416822200-31088-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1416822200-31088-3-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qnDOdF0WIgjP6J9Q90TOd9kQrcHslPPsI" Subject: Re: [Qemu-devel] [PATCH v3 2/5] block: JSON filenames and relative backing files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qnDOdF0WIgjP6J9Q90TOd9kQrcHslPPsI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/24/2014 02:43 AM, Max Reitz wrote: > When using a relative backing file name, qemu needs to know the > directory of the top image file. For JSON filenames, such a directory > cannot be easily determined (e.g. how do you determine the directory of= > a qcow2 BDS directly on top of a quorum BDS?). Therefore, do not allow > relative filenames for the backing file of BDSs only having a JSON > filename. >=20 > Furthermore, BDS::exact_filename should be used whenever possible. If > BDS::filename is not equal to BDS::exact_filename, the former will > always be a JSON object. >=20 > Signed-off-by: Max Reitz > --- > block.c | 27 +++++++++++++++++++++------ > block/qapi.c | 7 ++++++- > include/block/block.h | 5 +++-- > 3 files changed, 30 insertions(+), 9 deletions(-) >=20 > diff --git a/block.c b/block.c > index 0c1be37..a0cddcd 100644 > --- a/block.c > +++ b/block.c > @@ -305,19 +305,28 @@ void path_combine(char *dest, int dest_size, > =20 > void bdrv_get_full_backing_filename_from_filename(const char *backed, > const char *backing,= > - char *dest, size_t s= z) > + char *dest, size_t s= z, > + Error **errp) > { > - if (backing[0] =3D=3D '\0' || path_has_protocol(backing)) { > + if (backing[0] =3D=3D '\0' || path_has_protocol(backing) || > + path_is_absolute(backing)) > + { checkpatch.pl didn't complain about this? The { should be on the previous line. With that fixed, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --qnDOdF0WIgjP6J9Q90TOd9kQrcHslPPsI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUdN8TAAoJEKeha0olJ0NqEUIH/Rrf0YHOkCEUGg9qUEqPOqOo /8jNIpm2tDaiu7AJvy7RPa/UG6vhIWy3EqTTNTd4vzI4tW+YS+WxrD20e9jqbE3K x4hDwqJYjlTdauPoORh5kiAdeuoOjbbqnHe1khzx2ZGjFVRU4iEOG4w/Qgj7oBpZ gG7du/18UiV0fxX+E3IJQPEZz3K/jYkMk7137RJKkyq9bzDUN3JmQWc3aO7zaiBB RV20YAsHtrhvCBzwTWYE1Oy2kHmf4CqjEaoO0Uq9dYWK7G7qnXZXe1Vg9z0RxwkE oAFwUpdY3UCrL/iTDzP0CUCb8lXBzSBQyOegL59tSUXmzlBX34R0gE6tX7XdOm0= =Tzlo -----END PGP SIGNATURE----- --qnDOdF0WIgjP6J9Q90TOd9kQrcHslPPsI--