Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2198120/?format=api
{ "id": 2198120, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198120/?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-3-vsementsov@yandex-team.ru>", "date": "2026-02-19T11:55:23", "name": "[v11,2/8] net/tap: move vhost initialization to tap_setup_vhost()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "3473f4c25583a0addcd4b8846f4d7efe667501e7", "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-3-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/2198120/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=uFY82wqL;\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 4fGsKl5PwSz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 22:56:26 +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 1vt2dN-0004Pm-2C; Thu, 19 Feb 2026 06:55:53 -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 1vt2dB-0004NN-JQ\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 06:55:42 -0500", "from forwardcorp1b.mail.yandex.net\n ([2a02:6b8:c02:900:1:45:d181:df01])\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 1vt2d8-0006DE-8z\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 06:55:40 -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 92D5080878;\n Thu, 19 Feb 2026 14:55:36 +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-lpbtJ6aw; Thu, 19 Feb 2026 14:55:36 +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=1771502136;\n bh=fF0WU7Y5ApYR2lkAVIV/MqBLwBoq0YXSQE5sJlwnsPM=;\n h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From;\n b=uFY82wqLwx2GK6Ar9Pt93oNYlU/mqfxZPsCqOzQSkdtch//Fmxp8H0N61Vk4LIaKJ\n 6i85djid4dg43ruC7QC2U3SZNAJ0ye4sjyObFRIUCJBtuhHN183Rgj4Ovw9EXumwgc\n lnyndiddghYqo6875DmxCBIweiUmNaenVAglhypg=", "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 2/8] net/tap: move vhost initialization to\n tap_setup_vhost()", "Date": "Thu, 19 Feb 2026 14:55:23 +0300", "Message-ID": "<20260219115530.2019498-3-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=2a02:6b8:c02:900:1:45:d181:df01;\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, SPF_HELO_NONE=0.001,\n 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": "Make a new helper function in a way it can be reused later for\nTAP fd-migration feature: we'll need to initialize vhost in a later\npoint when we doesn't have access to QAPI parameters.\n\nSigned-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>\n---\n net/tap.c | 62 ++++++++++++++++++++++++++++++++++---------------------\n 1 file changed, 38 insertions(+), 24 deletions(-)", "diff": "diff --git a/net/tap.c b/net/tap.c\nindex 1245b98408..294ca61f8b 100644\n--- a/net/tap.c\n+++ b/net/tap.c\n@@ -71,6 +71,8 @@ static const int kernel_feature_bits[] = {\n typedef struct TAPState {\n NetClientState nc;\n int fd;\n+ int vhostfd;\n+ uint32_t vhost_busyloop_timeout;\n char down_script[1024];\n char down_script_arg[128];\n uint8_t buf[NET_BUFSIZE];\n@@ -702,6 +704,38 @@ static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr,\n return fd;\n }\n \n+static bool tap_setup_vhost(TAPState *s, Error **errp)\n+{\n+ VhostNetOptions options;\n+\n+ if (s->vhostfd == -1) {\n+ return true;\n+ }\n+\n+ options.backend_type = VHOST_BACKEND_TYPE_KERNEL;\n+ options.net_backend = &s->nc;\n+ options.busyloop_timeout = s->vhost_busyloop_timeout;\n+ options.opaque = (void *)(uintptr_t)s->vhostfd;\n+ options.nvqs = 2;\n+ options.feature_bits = kernel_feature_bits;\n+ options.get_acked_features = NULL;\n+ options.save_acked_features = NULL;\n+ options.max_tx_queue_size = 0;\n+ options.is_vhost_user = false;\n+\n+ s->vhost_net = vhost_net_init(&options);\n+ if (!s->vhost_net) {\n+ error_setg(errp,\n+ \"vhost-net requested but could not be initialized\");\n+ return false;\n+ }\n+\n+ /* vhostfd ownership is passed to s->vhost_net */\n+ s->vhostfd = -1;\n+\n+ return true;\n+}\n+\n static bool net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,\n const char *name,\n const char *ifname, const char *script,\n@@ -736,30 +770,10 @@ static bool net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,\n }\n }\n \n- if (vhostfd != -1) {\n- VhostNetOptions options;\n-\n- options.backend_type = VHOST_BACKEND_TYPE_KERNEL;\n- options.net_backend = &s->nc;\n- if (tap->has_poll_us) {\n- options.busyloop_timeout = tap->poll_us;\n- } else {\n- options.busyloop_timeout = 0;\n- }\n- options.opaque = (void *)(uintptr_t)vhostfd;\n- options.nvqs = 2;\n- options.feature_bits = kernel_feature_bits;\n- options.get_acked_features = NULL;\n- options.save_acked_features = NULL;\n- options.max_tx_queue_size = 0;\n- options.is_vhost_user = false;\n-\n- s->vhost_net = vhost_net_init(&options);\n- if (!s->vhost_net) {\n- error_setg(errp,\n- \"vhost-net requested but could not be initialized\");\n- goto failed;\n- }\n+ s->vhostfd = vhostfd;\n+ s->vhost_busyloop_timeout = tap->has_poll_us ? tap->poll_us : 0;\n+ if (!tap_setup_vhost(s, errp)) {\n+ return false;\n }\n \n return true;\n", "prefixes": [ "v11", "2/8" ] }