From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Cc: svt-core@virtuozzo.com, den@openvz.org
Subject: Re: [QEMU HCI-8.0 PATCH 4/5] vhost-blk: watch the device for resize events
Date: Thu, 3 Sep 2026 17:50:55 +0200 [thread overview]
Message-ID: <22725f1b-6328-4e0c-bfec-c510361af6a2@virtuozzo.com> (raw)
In-Reply-To: <58f6e4e1-d9f0-48b5-8a6a-e1045924117a@virtuozzo.com>
On 9/3/26 17:45, Andrey Drobyshev wrote:
> On 9/3/26 6:30 PM, Andrey Zhadchenko wrote:
>>
>>
>> On 9/3/26 16:56, Andrey Drobyshev wrote:
>>> The approach introduced by this and subsequent patches, i.e. subscribing
>>> to NETLINK_KOBJECT_UEVENT and filtering them - that looks very kludgy
>>> for production and will unlikely be ever accepted upstream.
>>
>> I also think qmp command is much cleaner.
>>
>>>
>>> So, QEMU must get the knowledge about updated size. It can only do so
>>> by getting this knowledge from libvirt (as it used to be with
>>> qmp_block_resize) or from the kernel via some kind of notification.
>>
>> Updated size can be read again with llseek/BLKSZGET. I would avoid
>> passing it into QEMU explicitly via QMP (we also don't pass it during
>> the start, so it matches)
>
> Currently libvirt calls QMP block-resize which has size as an explicit
> argument. You're saying we should just issue a command with no args,
> smth like 'qmp_trigger_size_reread'. That's generally fine, but what if
> for some reason final size which we get by lseek() doesn't match what
> was requested from libvirt? When passing an argument we can at least
> compare the expectation vs reality and emit an error.
I don't think that detecting size mismatch makes much sense. It won't
protect us against concurrent resize anyway (it can happen after lseek,
etc.) and just increase the amount of code.
In my opinion it is perfectly fine to infer the size from the device
instead of doing it + also checking against user input.
>
>>
>>>
>>> So our options:
>>>
>>> 1. Another QMP command sent directly from libvirt, smth like
>>> 'vhost-blk-config-update id=virtio-disk0 data={...}'
>>>
>>> 2. Patching the kernel so it knows the size, caches it. Making ploop
>>> send an ioctl to inform the kernel about new size. Then establishing
>>> eventfd from vhost-blk backend -> qemu, and processing the events.
>>>
>>> I think 1st is cleaner and requires less work.
>>>
>>> Andrey
>>>
>>
>
next prev parent reply other threads:[~2026-09-03 15:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 12:31 [QEMU HCI-8.0 PATCH 0/5] vhost-blk change backend setup Andrey Zhadchenko
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 1/5] blk: factor out validation Andrey Zhadchenko
2026-09-03 14:56 ` Andrey Drobyshev
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 2/5] vhost-blk: change backend setup Andrey Zhadchenko
2026-09-03 14:56 ` Andrey Drobyshev
2026-09-03 15:27 ` Andrey Zhadchenko
2026-09-03 15:34 ` Andrey Drobyshev
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 3/5] vhost-blk: add read-only flag Andrey Zhadchenko
2026-09-03 14:56 ` Andrey Drobyshev
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 4/5] vhost-blk: watch the device for resize events Andrey Zhadchenko
2026-09-03 14:56 ` Andrey Drobyshev
2026-09-03 15:30 ` Andrey Zhadchenko
2026-09-03 15:45 ` Andrey Drobyshev
2026-09-03 15:50 ` Andrey Zhadchenko [this message]
2026-09-03 12:32 ` [QEMU HCI-8.0 PATCH 5/5] vhost-blk: filter uevents in the kernel Andrey Zhadchenko
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=22725f1b-6328-4e0c-bfec-c510361af6a2@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=den@openvz.org \
--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.