All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v'
@ 2015-04-17 12:44 Alberto Garcia
  2015-04-17 12:56 ` Eric Blake
  2015-04-17 14:40 ` Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Alberto Garcia @ 2015-04-17 12:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Peter Maydell, Alberto Garcia

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v'
  2015-04-17 12:44 [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v' Alberto Garcia
@ 2015-04-17 12:56 ` Eric Blake
  2015-04-17 14:40 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2015-04-17 12:56 UTC (permalink / raw)
  To: Alberto Garcia, qemu-devel; +Cc: Kevin Wolf, Peter Maydell

[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]

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.
> 
> 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(-)

Reviewed-by: Eric Blake <eblake@redhat.com>


> 
> 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) {
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v'
  2015-04-17 12:44 [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v' Alberto Garcia
  2015-04-17 12:56 ` Eric Blake
@ 2015-04-17 14:40 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-04-17 14:40 UTC (permalink / raw)
  To: Alberto Garcia; +Cc: Kevin Wolf, QEMU Developers

On 17 April 2015 at 13:44, Alberto Garcia <berto@igalia.com> wrote:
> 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>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-17 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-17 12:44 [Qemu-devel] [PATCH for-2.3] hmp: fix crash in 'info block -n -v' Alberto Garcia
2015-04-17 12:56 ` Eric Blake
2015-04-17 14:40 ` Peter Maydell

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.