Received: from eggs.gnu.org ([2001:4830:134:3::10]:45738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkYDh-0004US-Vj for qemu-devel@nongnu.org; Tue, 21 Apr 2015 09:28:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkYDe-0006nN-RK for qemu-devel@nongnu.org; Tue, 21 Apr 2015 09:28:09 -0400 Date: Tue, 21 Apr 2015 14:28:01 +0100 From: Stefan Hajnoczi Message-ID: <20150421132801.GE16345@stefanha-thinkpad.redhat.com> References: <1429271563-3765-1-git-send-email-berto@igalia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kA1LkgxZ0NN7Mz3A" Content-Disposition: inline In-Reply-To: <1429271563-3765-1-git-send-email-berto@igalia.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] qmp: fill in the image field in BlockDeviceInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org --kA1LkgxZ0NN7Mz3A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 17, 2015 at 02:52:43PM +0300, Alberto Garcia wrote: > The image field in BlockDeviceInfo is supposed to contain an ImageInfo > object. However that is being filled in by bdrv_query_info(), not by > bdrv_block_device_info(), which is where BlockDeviceInfo is actually > created. >=20 > Anyone calling bdrv_block_device_info() directly will get a null image > field. As a consequence of this, the HMP command 'info block -n -v' > crashes QEMU. >=20 > This patch moves the code that fills in that field from > bdrv_query_info() to bdrv_block_device_info(). >=20 > Signed-off-by: Alberto Garcia > --- > block.c | 9 +++++++-- > block/qapi.c | 46 +++++++++++++++++++++++++--------------------- > blockdev.c | 2 +- > include/block/block.h | 2 +- > include/block/qapi.h | 2 +- > 5 files changed, 35 insertions(+), 26 deletions(-) For the record, the following patch has been merged instead: [PATCH for-2.3] hmp: fix crash in 'info block -n -v' --kA1LkgxZ0NN7Mz3A Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVNlBhAAoJEJykq7OBq3PIFNcIAJZz+YPzt+/lbMiTyUECwVsn Uq6KLHbRM00x0nMkncX0pcT/FGgO6KYRDxpVkZTGVgX9IVBfgAVQ4owtUsG9X2ti dPjF4vdvSQy2pgzD2SvIESaBONMbvOuYdU9t+Dsmymf12Zwg9jysBdiZ+f6j8yui Iy2qLGlFoYVCHPYrvES5gFXWH4naJsASmec0xREGBSSIIhCfeOhSOA73fAm/jdJ5 S8Uj+tFApnjkI4VeQIwSJbRqwMh9jIUNQhgoJnPSKsaKRguv9apxEdZ/0d5zvszd tr+lvSKeCLxYaBcI+t5XohQammItTtjoa7frXxPsCL75m/asH/ejWqxDwBceH5o= =ggvB -----END PGP SIGNATURE----- --kA1LkgxZ0NN7Mz3A--