From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj7YL-00033Z-AO for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj7YJ-0003tH-Lb for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:47:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj7YJ-0003tD-Fp for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:47:31 -0400 Message-ID: <553102FD.6080209@redhat.com> Date: Fri, 17 Apr 2015 06:56:29 -0600 From: Eric Blake MIME-Version: 1.0 References: <1429274688-8115-1-git-send-email-berto@igalia.com> In-Reply-To: <1429274688-8115-1-git-send-email-berto@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qtwnc0RisftHAHlJKwEF21U08avfhaeUs" Subject: Re: [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Maydell This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qtwnc0RisftHAHlJKwEF21U08avfhaeUs Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/17/2015 06:44 AM, Alberto Garcia wrote: > The image field in BlockDeviceInfo should never be null, however > bdrv_block_device_info() is not filling it in. >=20 > This makes the 'info block -n -v' command crash QEMU. >=20 > The proper solution is probably to move the relevant code from > bdrv_query_info() to bdrv_block_device_info(), but since we're too > close to the release for that this simpler workaround solves the > crash. >=20 > Signed-off-by: Alberto Garcia > --- > hmp.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake >=20 > diff --git a/hmp.c b/hmp.c > index f31ae27..f142d36 100644 > --- a/hmp.c > +++ b/hmp.c > @@ -391,7 +391,8 @@ static void print_block_info(Monitor *mon, BlockInf= o *info, > inserted->iops_size); > } > =20 > - if (verbose) { > + /* TODO: inserted->image should never be null */ > + if (verbose && inserted->image) { > monitor_printf(mon, "\nImages:\n"); > image_info =3D inserted->image; > while (1) { >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --qtwnc0RisftHAHlJKwEF21U08avfhaeUs 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/ iQEcBAEBCAAGBQJVMQL9AAoJEKeha0olJ0NqOwEH/2NzFxwXLjDiZ/R4MxIqitvF oM8EtmVJxwPPFZLnz3O8r8lHcMn7aSiAJxQc7x+dXqkAktRF/Wkhy0nVUAgP6cg6 173EkqyOxCEBlwwyG8RzL6VHWa795/EFbXuBdr2qOfypjM1vpwJJFSqpKuqR8Qlq 4VpQMLAowRFfjxKqRZGpInUd0XcxgWTEJ8WM72HW0cFX4aI5LadlMilc7ECMwF6y r9gto07ylUbNfHMNB58nDWcioK8KKHgfg4zNu9NbRu+CszyV29iXvNACNddPZNhV MbOcgJcVDbWvD24Knfdi6oVfOgAIu0hPxc4zSN3i13EVGVeVR0pu91e/9gOeYuQ= =fRH8 -----END PGP SIGNATURE----- --qtwnc0RisftHAHlJKwEF21U08avfhaeUs--