From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKY5D-0007ta-Eu for qemu-devel@nongnu.org; Fri, 13 Sep 2013 14:27:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKY56-0008Fy-Sw for qemu-devel@nongnu.org; Fri, 13 Sep 2013 14:27:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKY56-0008Fs-Iy for qemu-devel@nongnu.org; Fri, 13 Sep 2013 14:27:00 -0400 Message-ID: <523358EB.20502@redhat.com> Date: Fri, 13 Sep 2013 12:26:51 -0600 From: Eric Blake MIME-Version: 1.0 References: <1379067909-22984-1-git-send-email-pl@kamp.de> <1379067909-22984-11-git-send-email-pl@kamp.de> In-Reply-To: <1379067909-22984-11-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3NVmrjgWwjbhPJQafJfXSCidsQmT5LEbj" Subject: Re: [Qemu-devel] [PATCH 10/12] block/get_block_status: avoid segfault if there is no backing_hd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, stefanha@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3NVmrjgWwjbhPJQafJfXSCidsQmT5LEbj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/13/2013 04:25 AM, Peter Lieven wrote: > Signed-off-by: Peter Lieven > --- > block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake >=20 > diff --git a/block.c b/block.c > index 4922fb9..cf9db62 100644 > --- a/block.c > +++ b/block.c > @@ -3156,7 +3156,7 @@ static int64_t coroutine_fn bdrv_co_get_block_sta= tus(BlockDriverState *bs, > if (!(ret & BDRV_BLOCK_DATA)) { > if (bdrv_has_zero_init(bs)) { > ret |=3D BDRV_BLOCK_ZERO; > - } else { > + } else if (bs->backing_hd) { > BlockDriverState *bs2 =3D bs->backing_hd; > int64_t length2 =3D bdrv_getlength(bs2); > if (length2 >=3D 0 && sector_num >=3D (length2 >> BDRV_SEC= TOR_BITS)) { >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3NVmrjgWwjbhPJQafJfXSCidsQmT5LEbj 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.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSM1jrAAoJEKeha0olJ0Nq/yAIAKO7tE2jI8AZG5/W9yaZkwdb Ye3jleaa9JNneAEmD7AaEEAnWrcgiZSF9/PYjbURfEdIbydX5OfLLbL7zQtVREk6 wTiK5wIP7YEr9BKPMo4z0keN30/9AzboMwtEWdoKs9s6x6ElaHlfiJ/0c4tWKMrA 7TRAmMlNccv8tERII9VklYV0Y2MTYGMmGR4SprM9C8wD3KNc9PxZuHoLym+1g1Eb 1EWXps6Lh5UZuqECyEsG0QfWbn8a9vCSRwhaNAHnLnttQmdRDluGow9yleuFraz4 aRBPp4Tk3aeAC2HXvLN0EZ4TDNhZWfn+x9HT6qDVwZP4RDQhVWNUnmUCENU/mMw= =Q5Xx -----END PGP SIGNATURE----- --3NVmrjgWwjbhPJQafJfXSCidsQmT5LEbj--