From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2LPS-0006z6-D0 for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:25:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2LPR-0000pv-9U for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:25:50 -0400 Date: Tue, 9 Jun 2015 16:25:36 +0100 From: Stefan Hajnoczi Message-ID: <20150609152536.GD3181@stefanha-thinkpad.redhat.com> References: <1433840108-9996-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MAH+hnPXVZWQ5cD/" Content-Disposition: inline In-Reply-To: <1433840108-9996-1-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] raw-posix: Fix .bdrv_co_get_block_status() for unaligned image size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, eharney@redhat.com, stefanha@redhat.com, crobinso@redhat.com, pbonzini@redhat.com --MAH+hnPXVZWQ5cD/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 09, 2015 at 10:55:08AM +0200, Kevin Wolf wrote: > Image files with an unaligned image size have a final hole that starts > at EOF, i.e. in the middle of a sector. Currently, *pnum =3D=3D 0 is > returned when checking the status of this sector. In qemu-img, this > triggers an assertion failure. >=20 > In order to fix this, one type for the sector that contains EOF must be > found. Treating a hole as data is safe, so this patch rounds the > calculated number of data sectors up, so that a partial sector at EOF is > treated as a full data sector. >=20 > This fixes https://bugzilla.redhat.com/show_bug.cgi?id=3D1229394 >=20 > Signed-off-by: Kevin Wolf > --- > block/raw-posix.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan --MAH+hnPXVZWQ5cD/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVdwVwAAoJEJykq7OBq3PIyAsIAJPV7F2ISdbFrUB2i4G/Qem9 e6o6/mpggaS1bvbym+pbsxivmS8LRKTHeBKKZAT2KDv/d8xAMbzu2HnSAQT2UeyN Tl+2b74FqNa2AV8y62Ne8J92Xe8HDLVz7urHx2E2mZJfPQazaIYni32f8EiM0cim 0U0u7Wq1ccHcL9ac+jomznn/JelWE/xAEOv+GrAujmFbkmbkw/FqJcVv4x+cH3Bu eMuT1dd+eJ2jXarq+PHQajiRKMs+3lpLIN/yNFfpyK1O2oyH2ptQglD/s/znmJG8 f5FI16lyBeZMnZ9Tx/AkFowxB9eY8F4paJKhZn6A4PxSXt/Le42yEV76Otw6MP0= =kLB3 -----END PGP SIGNATURE----- --MAH+hnPXVZWQ5cD/--