From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>,
svt-core@virtuozzo.com
Subject: Re: [PATCH hci-8.1/hci-8.2] vhost-blk: add .get_vhost() callback #VSTOR-156756
Date: Wed, 25 Nov 2026 01:21:54 +0100 [thread overview]
Message-ID: <e3b26ecc-3d0f-4540-abc0-fc6a11b90ff4@virtuozzo.com> (raw)
In-Reply-To: <20261123170603.98512-1-andrey.drobyshev@virtuozzo.com>
Reviewed-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
On 11/23/26 18:06, Andrey Drobyshev wrote:
> Currently QMP command x-query-virtio-status on a vhost-blk disk leads to
> SIGSEGV:
>
> #1 0x000055de877be9f1 in qmp_x_query_virtio_status (path=0x55deb3e79030 "/machine/peripheral/virtio-disk1/virtio-backend", errp=0x7f5501a81f80)
> at ../hw/virtio/virtio-qmp.c:814
> #2 0x000055de87a1c8ec in qmp_marshal_x_query_virtio_status (args=0x7f53ec003a20, ret=0x7f550017dfa8, errp=0x7f550017dfb0) at qapi/qapi-commands-virtio.c:126
> #3 0x000055de87a580be in do_qmp_dispatch_bh (opaque=0x7f550017dfb8) at ../qapi/qmp-dispatch.c:128
> ...
> #14 0x000055de87537a75 in qemu_main_loop () at ../system/runstate.c:910
> #15 0x000055de879681a2 in qemu_default_main (opaque=0x0) at ../system/main.c:51
>
> That's because this command leads to calling .get_vhost() method which
> TYPE_VHOST_BLK never realizes. Let's add a simple implementation
> returning that pointer.
>
> QMP commands x-query-virtio-vhost-queue-status, x-query-virtio-queue-status
> are also affected by this bug and fixed by the callback implementation.
>
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
> ---
> hw/block/vhost-blk.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/hw/block/vhost-blk.c b/hw/block/vhost-blk.c
> index ffd647bfef2..80cfe8e1eff 100644
> --- a/hw/block/vhost-blk.c
> +++ b/hw/block/vhost-blk.c
> @@ -784,6 +784,12 @@ static void vhost_blk_update_config(VirtIODevice *vdev, uint8_t *config)
> memcpy(config, &blkcfg, sizeof(struct virtio_blk_config));
> }
>
> +static struct vhost_dev *vhost_blk_get_vhost(VirtIODevice *vdev)
> +{
> + VHostBlk *s = VHOST_BLK(vdev);
> + return &s->dev;
> +}
> +
> static const Property vhost_blk_properties[] = {
> DEFINE_PROP_STRING("devpath", VHostBlk, conf.devpath),
> DEFINE_PROP_STRING("ueventfd", VHostBlk, conf.ueventfd),
> @@ -826,6 +832,7 @@ static void vhost_blk_class_init(ObjectClass *klass, const void *data)
> vdc->get_features = vhost_blk_get_features;
> vdc->set_status = vhost_blk_set_status;
> vdc->reset = vhost_blk_reset;
> + vdc->get_vhost = vhost_blk_get_vhost;
> }
>
> static void vhost_blk_instance_init(Object *obj)
prev parent reply other threads:[~2026-11-25 0:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 17:06 Andrey Drobyshev
2026-11-23 17:16 ` no-reply
2026-11-25 0:21 ` Andrey Zhadchenko [this message]
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=e3b26ecc-3d0f-4540-abc0-fc6a11b90ff4@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=svt-core@virtuozzo.com \
/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.