From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: mst@redhat.com, jasowang@redhat.com, pbonzini@redhat.com,
berrange@redhat.com, eduardo@habkost.net, peterx@redhat.com,
farosas@suse.de, eblake@redhat.com, thuth@redhat.com,
philmd@linaro.org, zhao1.liu@intel.com, qemu-devel@nongnu.org,
leiyang@redhat.com, davydov-max@yandex-team.ru,
yc-core@yandex-team.ru, raphael.s.norwitz@gmail.com
Subject: Re: [PATCH v9 3/8] qapi: add backend-transfer migration parameter
Date: Thu, 06 Nov 2025 16:44:41 +0100 [thread overview]
Message-ID: <87ecqbf9na.fsf@pond.sub.org> (raw)
In-Reply-To: <20251030203116.870742-4-vsementsov@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Thu, 30 Oct 2025 23:31:10 +0300")
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> We are going to implement backend-transfer feature: some devices
> will be able to transfer their backend through migration stream
> for local migration through UNIX domain socket. For example,
> virtio-net will migrate its attached TAP netdev, with all its
> connected file descriptors.
>
> In this commit we introduce a migration parameter, which pick
> devices for backend-transfer migration in context of next
> outgoing or incoming migration. Of course, user is responsible
> to pick same set of devices on source and target.
>
> QMP command query-backend-transfer-support command may help
> to prepare such set as intersection of
> query-backend-transfer-support results on source and target.
>
> With this commit, no device yet support backend-transfer,
> so passing something other then empty list to backend-transfer
> migration parameter will fail.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
[...]
> void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp)
> diff --git a/qapi/migration.json b/qapi/migration.json
> index be0f3fcc12..9478c4ddab 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -951,9 +951,15 @@
> # is @cpr-exec. The first list element is the program's filename,
> # the remainder its arguments. (Since 10.2)
> #
> +# @backend-transfer: List of devices (IDs or QOM paths) for
> +# backend-transfer migration. When enabled, device backends
> +# including opened fds will be passed to the destination in the
> +# migration channel (which must be a UNIX domain socket). Default
> +# is no backend-transfer migration. (Since 10.2)
Two spaces after '.', please.
> +#
> # Features:
> #
> -# @unstable: Members @x-checkpoint-delay and
> +# @unstable: Members @backend-transfer, @x-checkpoint-delay and
> # @x-vcpu-dirty-limit-period are experimental.
> #
> # Since: 2.4
> @@ -978,7 +984,8 @@
> 'mode',
> 'zero-page-detection',
> 'direct-io',
> - 'cpr-exec-command'] }
> + 'cpr-exec-command',
> + { 'name': 'backend-transfer', 'features': ['unstable'] } ] }
>
> ##
> # @MigrateSetParameters:
> @@ -1137,9 +1144,15 @@
> # is @cpr-exec. The first list element is the program's filename,
> # the remainder its arguments. (Since 10.2)
> #
> +# @backend-transfer: List of devices (IDs or QOM paths) for
> +# backend-transfer migration. When enabled, device backends
> +# including opened fds will be passed to the destination in the
> +# migration channel (which must be a UNIX domain socket). Default
> +# is no backend-transfer migration. (Since 10.2)
Likewise.
> +#
> # Features:
> #
> -# @unstable: Members @x-checkpoint-delay and
> +# @unstable: Members @backend-transfer, @x-checkpoint-delay and
> # @x-vcpu-dirty-limit-period are experimental.
> #
> # TODO: either fuse back into `MigrationParameters`, or make
> @@ -1179,7 +1192,9 @@
> '*mode': 'MigMode',
> '*zero-page-detection': 'ZeroPageDetection',
> '*direct-io': 'bool',
> - '*cpr-exec-command': [ 'str' ]} }
> + '*cpr-exec-command': [ 'str' ],
> + '*backend-transfer': { 'type': [ 'str' ],
> + 'features': [ 'unstable' ] } } }
>
> ##
> # @migrate-set-parameters:
> @@ -1352,9 +1367,15 @@
> # is @cpr-exec. The first list element is the program's filename,
> # the remainder its arguments. (Since 10.2)
> #
> +# @backend-transfer: List of devices (IDs or QOM paths) for
> +# backend-transfer migration. When enabled, device backends
> +# including opened fds will be passed to the destination in the
> +# migration channel (which must be a UNIX domain socket). Default
> +# is no backend-transfer migration. (Since 10.2)
Two spaces after '.', please.
> +#
> # Features:
> #
> -# @unstable: Members @x-checkpoint-delay and
> +# @unstable: Members @backend-transfer, @x-checkpoint-delay and
> # @x-vcpu-dirty-limit-period are experimental.
> #
> # Since: 2.4
> @@ -1391,7 +1412,9 @@
> '*mode': 'MigMode',
> '*zero-page-detection': 'ZeroPageDetection',
> '*direct-io': 'bool',
> - '*cpr-exec-command': [ 'str' ]} }
> + '*cpr-exec-command': [ 'str' ],
> + '*backend-transfer': { 'type': [ 'str' ],
> + 'features': [ 'unstable' ] } } }
>
> ##
> # @query-migrate-parameters:
> diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c
> index 9d3d961c15..549c77b2f0 100644
> --- a/system/qdev-monitor.c
> +++ b/system/qdev-monitor.c
> @@ -939,6 +939,19 @@ void qmp_device_del(const char *id, Error **errp)
> }
> }
>
> +bool migrate_backend_transfer(DeviceState *dev)
> +{
> + const strList *el = migrate_backend_transfer_list();
> +
> + for ( ; el; el = el->next) {
Please use
const strList *el;
for (el = migrate_backend_transfer_list(); el; el = el->next) {
> + if (find_device_state(el->value, false, NULL) == dev) {
> + return true;
> + }
> + }
> +
> + return false;
> +}
> +
> static bool qdev_backend_transfer_support(DeviceState *dev, Error **errp)
> {
> DeviceClass *dc = DEVICE_GET_CLASS(dev);
> @@ -952,6 +965,24 @@ static bool qdev_backend_transfer_support(DeviceState *dev, Error **errp)
> return dc->backend_transfer_support(dev, errp);
> }
>
> +bool migrate_backend_transfer_check_list(const strList *list, Error **errp)
> +{
> + const strList *el = list;
> +
> + for ( ; el; el = el->next) {
Likewise.
> + DeviceState *dev = find_device_state(el->value, true, errp);
> + if (!dev) {
> + return false;
> + }
> +
> + if (!qdev_backend_transfer_support(dev, errp)) {
> + return false;
> + }
> + }
> +
> + return true;
> +}
> +
> static int qdev_add_if_backend_transfer_supported(Object *obj, void *opaque)
> {
> DevPathList **list = opaque;
next prev parent reply other threads:[~2025-11-06 15:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 20:31 [PATCH v9 0/8] virtio-net: live-TAP local migration Vladimir Sementsov-Ogievskiy
2025-10-30 20:31 ` [PATCH v9 1/8] migration: introduce .pre_incoming() vmsd handler Vladimir Sementsov-Ogievskiy
2025-10-30 20:31 ` [PATCH v9 2/8] qapi: introduce query-backend-transfer-support Vladimir Sementsov-Ogievskiy
2025-11-06 15:30 ` Markus Armbruster
2025-11-06 19:27 ` Vladimir Sementsov-Ogievskiy
2025-11-07 5:28 ` Markus Armbruster
2025-11-07 6:09 ` Vladimir Sementsov-Ogievskiy
2025-10-30 20:31 ` [PATCH v9 3/8] qapi: add backend-transfer migration parameter Vladimir Sementsov-Ogievskiy
2025-11-06 15:44 ` Markus Armbruster [this message]
2025-10-30 20:31 ` [PATCH v9 4/8] net: introduce vmstate_net_peer_backend Vladimir Sementsov-Ogievskiy
2025-10-30 20:31 ` [PATCH v9 5/8] virtio-net: support backend-transfer migration Vladimir Sementsov-Ogievskiy
2025-10-30 20:31 ` [PATCH v9 6/8] net/tap: " Vladimir Sementsov-Ogievskiy
2025-10-30 20:31 ` [PATCH v9 7/8] tests/functional: add skipWithoutSudo() decorator Vladimir Sementsov-Ogievskiy
2025-10-30 20:31 ` [PATCH v9 8/8] 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=87ecqbf9na.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=davydov-max@yandex-team.ru \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=farosas@suse.de \
--cc=jasowang@redhat.com \
--cc=leiyang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=raphael.s.norwitz@gmail.com \
--cc=thuth@redhat.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.