All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: "Markus Armbruster" <armbru@redhat.com>,
	jasowang@redhat.com, mst@redhat.com, peterx@redhat.com,
	farosas@suse.de, raphael.s.norwitz@gmail.com, bchaney@akamai.com,
	qemu-devel@nongnu.org, berrange@redhat.com, pbonzini@redhat.com,
	yc-core@yandex-team.ru, mark.caveayland@nutanix.com,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Eric Blake" <eblake@redhat.com>
Subject: Re: [PATCH v18 12/14] net/tap: support local migration with virtio-net
Date: Mon, 13 Jul 2026 15:29:50 +0200	[thread overview]
Message-ID: <87y0fff25t.fsf@pond.sub.org> (raw)
In-Reply-To: <0fd09b96-068f-415d-9bd8-0506958710f1@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Mon, 13 Jul 2026 14:51:49 +0300")

Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:

> On 13.07.26 10:57, Markus Armbruster wrote:
>> Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
>> 
>>> Support transferring of TAP state (including open fd).
>>>
>>> Add new property "local-migration-supported", which defines
>>> whether local-migration is actually supported for this TAP device.
>>> Starting from 11.2 QEMU Machine Types it's enabled by default.
>>>
>>> Note, that local-migration (including migrating opened FDs
>> 
>> Scratch the comma after "Note", ...
>> 
>>> through migration channel, which must be UNIX socket), is
>> 
>> ... and the one before "is".
>> 
>>> enabled by global "local" migration parameters. But individual
>>> devices may have additional options to enable/disable it
>>> per device.
>>>
>>> The tricky thing, is that we need to know, should we do
>> 
>> Do you mean "The tricky thing is that we ween to know whether to call"?
>
> yes
>
>> 
>>> call open/connect in TAP initialization code. That means,
>>> that on incoming migration we want to know status of
>>> "local" migration parameter at time of creating TAP device.
>>> So, currently, for incoming local migration only TAP device
>>> created through QMP is supported, as you need to set migration
>>> parameter first (through QMP as well).

Possibly clearer:

    The tricky thing is that we need to know whether to call open/connect
    in TAP initialization code, i.e. we need to know the value of
    migration parameter "local" when creating the TAP device.  For
    incoming migration, we can know only for TAP devices created with QMP
    after setting the migration parameter with QMP.

>>>
>>> So the full picture is:
>>>
>>> On source, to start outgoing "local" migration you need:
>>>
>>>   - migration parameter "local" set to true
>>>   - "local-migration-supported" TAP option set to true (the
>>>     default, starting from 11.2 QEMU Machine Types)
>>>
>>> If at least one of these options is not set, TAP backend
>>> doesn't participate in migration.
>>>
>>> On target, things are more difficult:
>>>
>>> Same, you need both "local" and "local-migration-supported"
>>> be set. And same, if one of them is not set, TAP backend
>>> is initialized as usual, and doesn't accept any incoming
>>> state.
>>>
>>> Additionally, if you are going to set "local", it must be
>>> set before creating the TAP device. If TAP device created
>>> with "local" unset, it initializes as usual. If you enable
>>> "local" after it and start incoming migration, it will fail
>>> in .pre_load handler of TAP backend.
>> 
>> Out of curiosity, how would such a failure look like?
>
> TAP is initialized as usual, so the answer depends on the options.
>
> For incoming migration we should open TAP without "ifname" argument.
> If so (and "local" is not set), new TAP device will be created. It
> shouldn't trigger any additional problems I think.
>
>
> Checking with test:
>
>    diff --git a/tests/functional/x86_64/test_tap_migration.py b/tests/functional/x86_64/test_tap_migration.py
>    index bcc0a60dfe9..94982bc7b55 100755
>    --- a/tests/functional/x86_64/test_tap_migration.py
>    +++ b/tests/functional/x86_64/test_tap_migration.py
>    @@ -316,8 +316,8 @@ def prepare_and_launch_vm(
>             else:
>                 tap_name = TAP_ID
>
>    -        self.set_migration_capabilities(vm, local)
>             self.add_virtio_net(vm, vhost, tap_name, local, incoming)
>    +        self.set_migration_capabilities(vm, local)
>
>         def add_virtio_net(
>             self, vm, vhost: bool, tap_name: str, local: bool, incoming: bool
>
>
> Leads to
>
> qemu-system-x86_64: TAP is already initialized and cannot receive incoming fd
> qemu-system-x86_64: warning: qemu_fclose: received fd 27 was never claimed
> qemu-system-x86_64: load of migration failed: Invalid argument: error while loading state for instance 0x0 of device 'netdev.1/0/net-tap': pre load hook failed for: 'net-tap', version_id: 0, minimum version_id: 0, ret: -22
>
> on target, and failed migration, as expected.

How is the user supposed to reason their way from here to "oh, I need to
create my TAP device with QMP and after setting @local"?

>
>> 
>>> Moreover, there are interface restrictions: if you create TAP
>>> device when QEMU is in INCOMING state, and both "local"
>>> and "local-migration-supported" set, most of TAP options are
>>> not allowed, and script/downscript are required to be explicitly
>>> unset (set to "" or "no").
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

[...]



  reply	other threads:[~2026-07-13 13:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 19:17 [PATCH v18 00/14] virtio-net: live-TAP local migration Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 01/14] net/tap: rework tap_parse_script Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 02/14] net/tap: improve script/downscript options documentation Vladimir Sementsov-Ogievskiy
2026-07-13  7:33   ` Markus Armbruster
2026-07-10 19:17 ` [PATCH v18 03/14] net/tap: deprecate "no" as special value for script/downscript Vladimir Sementsov-Ogievskiy
2026-07-13  7:45   ` Markus Armbruster
2026-07-13  9:37     ` Vladimir Sementsov-Ogievskiy
2026-07-13  9:47       ` Daniel P. Berrangé
2026-07-13 10:25         ` Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 04/14] net/tap: move vhost-net open() calls to tap_parse_vhost_fds() Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 05/14] net/tap: move vhost initialization to tap_setup_vhost() Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 06/14] net/tap: use container_of instead of DO_UPCAST Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 07/14] net/tap: QOMify tap backend Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 08/14] net/tap: add TYPE_VMSTATE_IF interface Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 09/14] qapi: add local migration parameter Vladimir Sementsov-Ogievskiy
2026-07-13  9:51   ` Daniel P. Berrangé
2026-07-13 10:55     ` Vladimir Sementsov-Ogievskiy
2026-07-13 11:21       ` Daniel P. Berrangé
2026-07-13 17:55         ` Vladimir Sementsov-Ogievskiy
2026-07-13 18:37           ` Daniel P. Berrangé
2026-07-13 20:22             ` Michael S. Tsirkin
2026-07-14  6:50               ` Vladimir Sementsov-Ogievskiy
2026-07-14  8:03                 ` Michael S. Tsirkin
2026-07-14  8:04                   ` Vladimir Sementsov-Ogievskiy
2026-07-14  7:55               ` Daniel P. Berrangé
2026-07-14  8:02                 ` Michael S. Tsirkin
2026-07-14  8:18                   ` Daniel P. Berrangé
2026-07-14  6:45             ` Vladimir Sementsov-Ogievskiy
2026-07-10 19:17 ` [PATCH v18 10/14] virtio-net: support local migration of backend Vladimir Sementsov-Ogievskiy
2026-07-10 19:18 ` [PATCH v18 11/14] net/tap: disable read polling for stopped VM Vladimir Sementsov-Ogievskiy
2026-07-10 19:18 ` [PATCH v18 12/14] net/tap: support local migration with virtio-net Vladimir Sementsov-Ogievskiy
2026-07-13  7:57   ` Markus Armbruster
2026-07-13 11:51     ` Vladimir Sementsov-Ogievskiy
2026-07-13 13:29       ` Markus Armbruster [this message]
2026-07-13 15:08         ` Vladimir Sementsov-Ogievskiy
2026-07-14 13:19           ` Michael S. Tsirkin
2026-07-13 11:17   ` Daniel P. Berrangé
2026-07-13 12:35     ` Vladimir Sementsov-Ogievskiy
2026-07-13 15:05       ` Daniel P. Berrangé
2026-07-13 15:19         ` Vladimir Sementsov-Ogievskiy
2026-07-13 19:36   ` Michael S. Tsirkin
2026-07-14  6:43     ` Vladimir Sementsov-Ogievskiy
2026-07-10 19:18 ` [PATCH v18 13/14] tests/functional: add skipWithoutSudo() decorator Vladimir Sementsov-Ogievskiy
2026-07-10 19:18 ` [PATCH v18 14/14] tests/functional: add test_tap_migration Vladimir Sementsov-Ogievskiy

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=87y0fff25t.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=bchaney@akamai.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=jasowang@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=mark.caveayland@nutanix.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@mailo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.s.norwitz@gmail.com \
    --cc=vsementsov@yandex-team.ru \
    --cc=yc-core@yandex-team.ru \
    --cc=zhao1.liu@intel.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.