From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEGDm-0005MY-HJ for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:46:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEGDh-0002LN-Ib for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:46:46 -0500 Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]:41053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEGDh-0002L1-B9 for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:46:41 -0500 Received: by mail-we0-f176.google.com with SMTP id w62so1250929wes.7 for ; Thu, 22 Jan 2015 03:46:40 -0800 (PST) Date: Thu, 22 Jan 2015 11:46:37 +0000 From: Stefan Hajnoczi Message-ID: <20150122114637.GF28491@stefanha-thinkpad.redhat.com> References: <1673c994d5fc21a711576a5fbce49c68ec71ba2a.1421768887.git.jcody@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SxgehGEc6vB0cZwN" Content-Disposition: inline In-Reply-To: <1673c994d5fc21a711576a5fbce49c68ec71ba2a.1421768887.git.jcody@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 6/6] block: update string sizes for filename, backing_file, exact_filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, jsnow@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com --SxgehGEc6vB0cZwN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 20, 2015 at 12:31:33PM -0500, Jeff Cody wrote: > The string field entries 'filename', 'backing_file', and > 'exact_filename' in the BlockDriverState struct are defined as 1024 > bytes. >=20 > However, many places that use these values accept a maximum of PATH_MAX > bytes, so we have a mixture of 1024 byte and PATH_MAX byte allocations. > This patch makes the BlockDriverStruct field string sizes match usage. >=20 > This patch also does a few fixes related to the size that needs to > happen now: >=20 > * the block qapi driver is updated to use PATH_MAX bytes > * the qcow and qcow2 drivers have an additional safety check > * the block vvfat driver is updated to use PATH_MAX bytes > for the size of backing_file, for systems where PATH_MAX is < 1024 > bytes. > * qemu-img uses PATH_MAX rather than 1024. These instances were not > changed to be dynamically allocated, however, as the extra > temporary 3K in stack usage for qemu-img does not seem worrisome. >=20 > Signed-off-by: Jeff Cody > --- > block/qapi.c | 4 ++-- > block/qcow.c | 2 +- > block/qcow2.c | 3 ++- > block/vvfat.c | 4 ++-- > include/block/block_int.h | 8 ++++---- > qemu-img.c | 4 ++-- > 6 files changed, 13 insertions(+), 12 deletions(-) Reviewed-by: Stefan Hajnoczi --SxgehGEc6vB0cZwN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUwOMdAAoJEJykq7OBq3PIhLkH/0Qu9uc00cUQSXFantt9IUJd j5ZYuaqdE/RHZeU0+T6cNrN+B7Crje+mr65K05rENQe8iFWS7rzq+URWUy0dHeEo KOP1f3jARHNxaetad0W5lzZt72aCScBXLHWv8YmQGH3PHCKqi5tTqKo+lBkrby8t Xa17vdvlcaynF2WqhRNxlccrF5UIhAtwSuMb4hOBXcixGhVhgy+togYjfilouoCC cb8P6v/jShqJJmDnq6HwMc6Az+3SDjzVvhwDXw2BDOguZ7S6MbXhHegVHF+fkX0+ EIoISFY3VW5grae6IEj09x4M4qmtPpvYET6dFYrPL+wixHY046xHaVshit/XsV4= =4qSj -----END PGP SIGNATURE----- --SxgehGEc6vB0cZwN--