Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2198128/?format=api
{ "id": 2198128, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198128/?format=api", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.0/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260219115530.2019498-5-vsementsov@yandex-team.ru>", "date": "2026-02-19T11:55:25", "name": "[v11,4/8] net: introduce vmstate_net_peer_backend", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cec2bb2dae8d50dbb4eb123321557c3894adde6a", "submitter": { "id": 84116, "url": "http://patchwork.ozlabs.org/api/1.0/people/84116/?format=api", "name": "Vladimir Sementsov-Ogievskiy", "email": "vsementsov@yandex-team.ru" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260219115530.2019498-5-vsementsov@yandex-team.ru/mbox/", "series": [ { "id": 492667, "url": "http://patchwork.ozlabs.org/api/1.0/series/492667/?format=api", "date": "2026-02-19T11:55:27", "name": "virtio-net: live-TAP local migration", "version": 11, "mbox": "http://patchwork.ozlabs.org/series/492667/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2198128/checks/", "tags": {}, "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=yandex-team.ru header.i=@yandex-team.ru\n header.a=rsa-sha256 header.s=default header.b=ndy7lZ53;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)", "mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net;\n dkim=pass header.i=@yandex-team.ru" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGsM00fNSz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 22:57:32 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vt2dV-0004Ry-45; Thu, 19 Feb 2026 06:56:01 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <vsementsov@yandex-team.ru>)\n id 1vt2dD-0004Nh-N1\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 06:55:44 -0500", "from forwardcorp1b.mail.yandex.net ([178.154.239.136])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <vsementsov@yandex-team.ru>)\n id 1vt2dB-0006Du-Bh\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 06:55:43 -0500", "from mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net\n (mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net\n [IPv6:2a02:6b8:c24:fa2:0:640:41ee:0])\n by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id DB13F808A6;\n Thu, 19 Feb 2026 14:55:38 +0300 (MSK)", "from vsementsov-lin (unknown [2a02:6bf:8080:192::1:26])\n by mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net (smtpcorp/Yandex) with\n ESMTPSA id VtZwpM4A6uQ0-T5PuHanP; Thu, 19 Feb 2026 14:55:38 +0300" ], "Precedence": "bulk", "X-Yandex-Fwd": "1", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;\n s=default; t=1771502138;\n bh=uKqjTTla0ppSaS2iWSAYfvEBzwmJeIAv2EL1JoBxCqU=;\n h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From;\n b=ndy7lZ53HSoiauG6hrkn+rAsgSzyXlUM14FHyYHosTi9Bz+dvEtlwOqtO+rUEPUHp\n urTLT7JfYYW+dF7/Raype//LiEG4wBt+R/NWUw7N2sHC6rjR81IjvOmc+ZAgJhxbaM\n B2e/xedsfOlunfaZe6tSKEXhTlmDXLU5aAV7iYFI=", "From": "Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>", "To": "jasowang@redhat.com,\n\tmst@redhat.com", "Cc": "thuth@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de,\n peterx@redhat.com, zhao1.liu@intel.com, wangyanan55@huawei.com,\n philmd@linaro.org, marcel.apfelbaum@gmail.com, eduardo@habkost.net,\n davydov-max@yandex-team.ru, qemu-devel@nongnu.org,\n vsementsov@yandex-team.ru, yc-core@yandex-team.ru, leiyang@redhat.com,\n raphael.s.norwitz@gmail.com, bchaney@akamai.com", "Subject": "[PATCH v11 4/8] net: introduce vmstate_net_peer_backend", "Date": "Thu, 19 Feb 2026 14:55:25 +0300", "Message-ID": "<20260219115530.2019498-5-vsementsov@yandex-team.ru>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260219115530.2019498-1-vsementsov@yandex-team.ru>", "References": "<20260219115530.2019498-1-vsementsov@yandex-team.ru>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=178.154.239.136;\n envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "To implement backend migration in virtio-net in the next commit, we need\na generic API to migrate net backend. Here is it.\n\nSigned-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>\n---\n include/net/net.h | 4 ++++\n net/net.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 51 insertions(+)", "diff": "diff --git a/include/net/net.h b/include/net/net.h\nindex 45bc86fc86..aa34043b1a 100644\n--- a/include/net/net.h\n+++ b/include/net/net.h\n@@ -5,6 +5,7 @@\n #include \"qapi/qapi-types-net.h\"\n #include \"net/queue.h\"\n #include \"hw/core/qdev-properties-system.h\"\n+#include \"migration/vmstate.h\"\n \n #define MAC_FMT \"%02X:%02X:%02X:%02X:%02X:%02X\"\n #define MAC_ARG(x) ((uint8_t *)(x))[0], ((uint8_t *)(x))[1], \\\n@@ -110,6 +111,7 @@ typedef struct NetClientInfo {\n SetSteeringEBPF *set_steering_ebpf;\n NetCheckPeerType *check_peer_type;\n GetVHostNet *get_vhost_net;\n+ const VMStateDescription *backend_vmsd;\n } NetClientInfo;\n \n struct NetClientState {\n@@ -354,4 +356,6 @@ static inline bool net_peer_needs_padding(NetClientState *nc)\n return nc->peer && !nc->peer->do_not_pad;\n }\n \n+extern const VMStateInfo vmstate_net_peer_backend;\n+\n #endif\ndiff --git a/net/net.c b/net/net.c\nindex a176936f9b..8d09754fa0 100644\n--- a/net/net.c\n+++ b/net/net.c\n@@ -58,6 +58,7 @@\n #include \"qapi/string-output-visitor.h\"\n #include \"qapi/qobject-input-visitor.h\"\n #include \"standard-headers/linux/virtio_net.h\"\n+#include \"migration/vmstate.h\"\n \n /* Net bridge is currently not supported for W32. */\n #if !defined(_WIN32)\n@@ -2173,3 +2174,49 @@ int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size)\n assert(size == 0);\n return 0;\n }\n+\n+static int get_peer_backend(QEMUFile *f, void *pv, size_t size,\n+ const VMStateField *field)\n+{\n+ NetClientState *nc = pv;\n+ Error *local_err = NULL;\n+ int ret;\n+\n+ if (!nc->peer) {\n+ return -EINVAL;\n+ }\n+ nc = nc->peer;\n+\n+ ret = vmstate_load_state(f, nc->info->backend_vmsd, nc, 0, &local_err);\n+ if (ret < 0) {\n+ error_report_err(local_err);\n+ }\n+\n+ return ret;\n+}\n+\n+static int put_peer_backend(QEMUFile *f, void *pv, size_t size,\n+ const VMStateField *field, JSONWriter *vmdesc)\n+{\n+ NetClientState *nc = pv;\n+ Error *local_err = NULL;\n+ int ret;\n+\n+ if (!nc->peer) {\n+ return -EINVAL;\n+ }\n+ nc = nc->peer;\n+\n+ ret = vmstate_save_state(f, nc->info->backend_vmsd, nc, 0, &local_err);\n+ if (ret < 0) {\n+ error_report_err(local_err);\n+ }\n+\n+ return ret;\n+}\n+\n+const VMStateInfo vmstate_net_peer_backend = {\n+ .name = \"virtio-net-nic-nc-backend\",\n+ .get = get_peer_backend,\n+ .put = put_peer_backend,\n+};\n", "prefixes": [ "v11", "4/8" ] }