From: Alberto Garcia <berto@igalia.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Alberto Garcia <berto@igalia.com>
Subject: [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v'
Date: Fri, 17 Apr 2015 15:44:48 +0300 [thread overview]
Message-ID: <1429274688-8115-1-git-send-email-berto@igalia.com> (raw)
The image field in BlockDeviceInfo should never be null, however
bdrv_block_device_info() is not filling it in.
This makes the 'info block -n -v' command crash QEMU.
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.
Signed-off-by: Alberto Garcia <berto@igalia.com>
---
hmp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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, BlockInfo *info,
inserted->iops_size);
}
- if (verbose) {
+ /* TODO: inserted->image should never be null */
+ if (verbose && inserted->image) {
monitor_printf(mon, "\nImages:\n");
image_info = inserted->image;
while (1) {
--
2.1.4
next reply other threads:[~2015-04-17 12:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 12:44 Alberto Garcia [this message]
2015-04-17 12:56 ` [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v' Eric Blake
2015-04-17 14:40 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1429274688-8115-1-git-send-email-berto@igalia.com \
--to=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.