Development discussions about virtio-fs
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Cc: qemu-devel@nongnu.org, "Hanna Reitz" <hreitz@redhat.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>,
	"Jason Wang" <jasowang@redhat.com>, "Fam Zheng" <fam@euphon.net>,
	qemu-block@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"yc-core@yandex-team.ru" <yc-core@yandex-team.ru>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	virtio-fs@lists.linux.dev, "Kevin Wolf" <kwolf@redhat.com>,
	"zhenwei pi" <zhenwei.pi@linux.dev>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Milan Zamazal" <mzamazal@redhat.com>,
	"Raphael Norwitz" <rnorwitz@nvidia.com>
Subject: Re: [PATCH v5 4/6] vhost-user-blk: make inflight-migration prop mutable
Date: Wed, 29 Jul 2026 06:14:51 -0400	[thread overview]
Message-ID: <20260729061316-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <679a33d1-0f6c-4456-ac76-1f9e1251f2ec@yandex-team.ru>

On Wed, Jul 29, 2026 at 03:09:57PM +0500, Alexandr Moshkov wrote:
> 
> On 7/29/26 14:32, Michael S. Tsirkin wrote:
> 
>     On Tue, Jul 28, 2026 at 03:08:39PM +0500, Alexandr Moshkov wrote:
> 
>         When migrating from a QEMU version that supports inflight-migration to
>         an older one that does not, there is no way to disable the feature at
>         runtime — the VM must be stopped and reconfigured. This is impractical
>         in production environments.
> 
>         Make the inflight-migration property mutable after device realization
>         so it can be toggled via qom-set without restarting the VM.
> 
>         Acked-by: Raphael Norwitz <rnorwitz@nvidia.com>
>         Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
> 
> 
> 
>     I think I am beginning to understand.
> 
> 
>     You are running qemu with inflight-migration on and want to migrate
>     to qemu without inflight-migration at all.
> 
> 
>     Since it is guest transparent you could retrofit it like this.
> 
>     My question is why is it worth it, we do not normally support
>     migrating between qemu versions with different command lines.
> 
> I think you right. Maybe I've been focusing too much on the ability to migrate 
> between versions of qemu with and without inflight migration.
> 
> This series allows to turn off and on the inflight-migration feature at runtime
> without recreating the VM (it was the only way to turn off the feature, since
> the protocol feature could no longer be turned off, after initialization with
> the backend). This is more important feature, and it leads to the fact that
> this feature allows to migrate between different versions of qemu (with and
> without inflight-migration support).
> 
>     
> 
>         ---
>          hw/block/vhost-user-blk.c | 10 ++++++++--
>          1 file changed, 8 insertions(+), 2 deletions(-)
> 
>         diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
>         index e3b873af7c..650c004bde 100644
>         --- a/hw/block/vhost-user-blk.c
>         +++ b/hw/block/vhost-user-blk.c
>         @@ -619,6 +619,8 @@ static const VMStateDescription vmstate_vhost_user_blk = {
>              }
>          };
> 
>         +static PropertyInfo vhost_user_blk_inflight_migration_prop;
>         +
>          static const Property vhost_user_blk_properties[] = {
>              DEFINE_PROP_CHR("chardev", VHostUserBlk, chardev),
>              DEFINE_PROP_UINT16("num-queues", VHostUserBlk, num_queues,
>         @@ -632,8 +634,9 @@ static const Property vhost_user_blk_properties[] = {
>                                VIRTIO_BLK_F_WRITE_ZEROES, true),
>              DEFINE_PROP_BOOL("skip-get-vring-base-on-force-shutdown", VHostUserBlk,
>                               skip_get_vring_base_on_force_shutdown, false),
>         -    DEFINE_PROP_BOOL("inflight-migration", VHostUserBlk,
>         -                     inflight_migration, false),
>         +    DEFINE_PROP("inflight-migration", VHostUserBlk, inflight_migration,
>         +                vhost_user_blk_inflight_migration_prop, bool,
>         +                .set_default = true, .defval.u = false),
>          };
> 
>          static void vhost_user_blk_class_init(ObjectClass *klass, const void *data)
>         @@ -665,6 +668,9 @@ static const TypeInfo vhost_user_blk_info = {
> 
>          static void virtio_register_types(void)
>          {
>         +    vhost_user_blk_inflight_migration_prop = qdev_prop_bool;
>         +    vhost_user_blk_inflight_migration_prop.realized_set_allowed = true;
>         +
>              type_register_static(&vhost_user_blk_info);
>          }
> 
>     So then,  for example, let us say I paused the VM, then set the flag,
>     now inflight is on but GET_BASE did not drain it?
> 
> If I understood the question correctly, this is valid behavior. Before
> migration QEMU check protocol features to understand does the backend support
> inflight migration. If it does, after that QEMU migrate inflight buffer to
> other VM. If it's not, return error before migration started.  


I apologise i reverted the logic in the question.


I start vm and inflight is on.
I stop vm get base does not drain.
i turn inflight off.
now it looks like it will happily migrate?

>         --
>         2.34.1
> 


  parent reply	other threads:[~2026-07-29 10:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 10:08 [PATCH v5 0/6] vhost-user-blk: add compatibility with older qemu versions Alexandr Moshkov
2026-07-28 10:08 ` [PATCH v5 1/6] vhost-user: add skip_drain param to do_vhost_virtqueue_stop Alexandr Moshkov
2026-07-28 10:08 ` [PATCH v5 2/6] vhost-user: add GET_VRING_BASE_SKIP_DRAIN message Alexandr Moshkov
2026-07-29  9:14   ` Michael S. Tsirkin
2026-07-28 10:08 ` [PATCH v5 3/6] vhost-user: use skip_drain with " Alexandr Moshkov
2026-07-28 10:08 ` [PATCH v5 4/6] vhost-user-blk: make inflight-migration prop mutable Alexandr Moshkov
2026-07-29  9:32   ` Michael S. Tsirkin
     [not found]     ` <679a33d1-0f6c-4456-ac76-1f9e1251f2ec@yandex-team.ru>
2026-07-29 10:14       ` Michael S. Tsirkin [this message]
2026-07-29 10:35         ` Alexandr Moshkov
2026-07-29 10:48           ` Michael S. Tsirkin
     [not found]             ` <dd1f5830-75ff-4256-a179-6a8341a3b4ec@yandex-team.ru>
2026-07-29 12:13               ` Michael S. Tsirkin
2026-07-29 14:07                 ` Alexandr Moshkov
2026-07-29 14:48                   ` Michael S. Tsirkin
2026-07-29 15:18                     ` Alexandr Moshkov
2026-07-29 18:50                       ` Michael S. Tsirkin
2026-07-28 10:08 ` [PATCH v5 5/6] vhost-user-blk: move inflight_needed higher Alexandr Moshkov
2026-07-28 10:08 ` [PATCH v5 6/6] vhost-user-blk: use GET_VRING_BASE_SKIP_DRAIN during inflight migration Alexandr Moshkov
2026-07-29  9:14 ` [PATCH v5 0/6] vhost-user-blk: add compatibility with older qemu versions Michael S. Tsirkin

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=20260729061316-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=arei.gonglei@huawei.com \
    --cc=dtalexundeer@yandex-team.ru \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mzamazal@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rnorwitz@nvidia.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-fs@lists.linux.dev \
    --cc=vsementsov@yandex-team.ru \
    --cc=yc-core@yandex-team.ru \
    --cc=zhenwei.pi@linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox