qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] qmp: fill in the image field in BlockDeviceInfo


From: Alberto Garcia
Subject: Re: [Qemu-block] [PATCH] qmp: fill in the image field in BlockDeviceInfo
Date: Fri, 17 Apr 2015 14:14:28 +0200
User-agent: Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu)

On Fri 17 Apr 2015 01:52:43 PM CEST, Alberto Garcia <address@hidden> wrote:

> 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.
>
> This patch moves the code that fills in that field from
> bdrv_query_info() to bdrv_block_device_info().

And in case this change is too big/risky for 2.3, there's also the
simple workaround for the crash:

--- a/hmp.c
+++ b/hmp.c
@@ -391,7 +391,7 @@ static void print_block_info(Monitor *mon, BlockInfo *info,
                         inserted->iops_size);
     }
 
-    if (verbose) {
+    if (verbose && inserted->image) {
         monitor_printf(mon, "\nImages:\n");
         image_info = inserted->image;
         while (1) {

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]