Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2225308/?format=api
{ "id": 2225308, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2225308/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260420200339.708640-3-vsementsov@yandex-team.ru/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/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": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260420200339.708640-3-vsementsov@yandex-team.ru>", "list_archive_url": null, "date": "2026-04-20T20:03:17", "name": "[v6,02/22] vhost: drop backend_features field", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "88fde06f51d07c8c07d18b06081af6c2cd5daa10", "submitter": { "id": 84116, "url": "http://patchwork.ozlabs.org/api/1.2/people/84116/?format=api", "name": "Vladimir Sementsov-Ogievskiy", "email": "vsementsov@yandex-team.ru" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260420200339.708640-3-vsementsov@yandex-team.ru/mbox/", "series": [ { "id": 500672, "url": "http://patchwork.ozlabs.org/api/1.2/series/500672/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500672", "date": "2026-04-20T20:03:18", "name": "vhost refactoring and fixes", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/500672/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2225308/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2225308/checks/", "tags": {}, "related": [], "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=FyY28VTB;\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=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)", "mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net;\n dkim=pass header.i=@yandex-team.ru" ], "Received": [ "from lists1p.gnu.org (lists1p.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 4fzxMS67Wyz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 06:06:28 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wEur3-0001mG-Ey; Mon, 20 Apr 2026 16:04:25 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.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 1wEuqf-0001KB-3f; Mon, 20 Apr 2026 16:04:04 -0400", "from forwardcorp1d.mail.yandex.net ([178.154.239.200])\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 1wEuqW-0001kG-Tg; Mon, 20 Apr 2026 16:03:57 -0400", "from mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net\n (mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net\n [IPv6:2a02:6b8:c42:94a9:0:640:a3fa:0])\n by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id B666780725;\n Mon, 20 Apr 2026 23:03:50 +0300 (MSK)", "from vsementsov-lin (unknown [2a02:6bf:8080:54b::1:34])\n by mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net (smtpcorp) with ESMTPSA\n id f3YMX10K1Sw0-JhIwtFtH; Mon, 20 Apr 2026 23:03:49 +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=1776715430;\n bh=Gkxf+me90eN6ZhWRVM0cpnIRnA6GgN0WsU3pUhxePJg=;\n h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From;\n b=FyY28VTBtzookzoqAbpTHZE0UzivXrg+YR1m5lPHxhHT5RciOATqk5V7e7DTUhcF0\n OjOkgflKkq8Dbgyf77ZaWWMrl+NXY2ENqozTw+P83ntjUaiFWweLVbQLgnLNfanK1c\n MTrjV9+bC/kZV0TmSCQHUAY1scqyL6HwH5YnppEg=", "From": "Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>", "To": "mst@redhat.com", "Cc": "sgarzare@redhat.com, raphael@enfabrica.net, qemu-devel@nongnu.org,\n vsementsov@yandex-team.ru, yc-core@yandex-team.ru,\n d-tatianin@yandex-team.ru, devel@lists.libvirt.org,\n Markus Armbruster <armbru@redhat.com>,\n Raphael Norwitz <raphael.s.norwitz@gmail.com>,\n Raphael Norwitz <rnorwitz@nvidia.com>, Kevin Wolf <kwolf@redhat.com>,\n Hanna Reitz <hreitz@redhat.com>, Jason Wang <jasowang@redhat.com>,\n Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>,\n Eric Blake <eblake@redhat.com>,\n qemu-block@nongnu.org (open list:Block layer core)", "Subject": "[PATCH v6 02/22] vhost: drop backend_features field", "Date": "Mon, 20 Apr 2026 23:03:17 +0300", "Message-ID": "<20260420200339.708640-3-vsementsov@yandex-team.ru>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260420200339.708640-1-vsementsov@yandex-team.ru>", "References": "<20260420200339.708640-1-vsementsov@yandex-team.ru>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=178.154.239.200;\n envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1d.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": "This field is mostly unused and sometimes confusing. We even have\na TODO-like comment to drop it, the comment is removed in this commit.\n\nThe field is used to held VHOST_USER_F_PROTOCOL_FEATURES for vhost-user\nand/or VHOST_NET_F_VIRTIO_NET_HDR for vhost-net (which may be\nvhost-user-net). But we can simply recalculate these two flags in place\nfrom hdev->features, and from net-client for VHOST_NET_F_VIRTIO_NET_HDR.\n\nNote: removing field from x-query-virtio-status result is incompatible\nchange. We can do it because the command is unstable.\n\nCc: devel@lists.libvirt.org\nSigned-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>\nAcked-by: Markus Armbruster <armbru@redhat.com>\nReviewed-by: Daniil Tatianin <d-tatianin@yandex-team.ru>\nAcked-by: Raphael Norwitz <raphael.s.norwitz@gmail.com>\n---\n hw/block/vhost-user-blk.c | 1 -\n hw/net/vhost_net.c | 26 ++++++++++++++------------\n hw/scsi/vhost-scsi.c | 1 -\n hw/scsi/vhost-user-scsi.c | 1 -\n hw/virtio/vdpa-dev.c | 1 -\n hw/virtio/vhost-user.c | 17 ++++++++---------\n hw/virtio/virtio-hmp-cmds.c | 2 --\n hw/virtio/virtio-qmp.c | 4 ----\n include/hw/virtio/vhost.h | 7 -------\n qapi/virtio.json | 3 ---\n 10 files changed, 22 insertions(+), 41 deletions(-)", "diff": "diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c\nindex c151e836770..dc99de02635 100644\n--- a/hw/block/vhost-user-blk.c\n+++ b/hw/block/vhost-user-blk.c\n@@ -348,7 +348,6 @@ static int vhost_user_blk_connect(DeviceState *dev, Error **errp)\n s->dev.nvqs = s->num_queues;\n s->dev.vqs = s->vhost_vqs;\n s->dev.vq_index = 0;\n- s->dev.backend_features = 0;\n \n vhost_dev_set_config_notifier(&s->dev, &blk_ops);\n \ndiff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c\nindex 25e9f1fd244..fda90e231e6 100644\n--- a/hw/net/vhost_net.c\n+++ b/hw/net/vhost_net.c\n@@ -52,8 +52,14 @@ int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,\n \n void vhost_net_ack_features_ex(struct vhost_net *net, const uint64_t *features)\n {\n- virtio_features_copy(net->dev.acked_features_ex,\n- net->dev.backend_features_ex);\n+ virtio_features_clear(net->dev.acked_features_ex);\n+ if (net->backend == -1) {\n+ net->dev.acked_features =\n+ net->dev.features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES);\n+ } else if (!qemu_has_vnet_hdr(net->nc)) {\n+ net->dev.acked_features = 1ULL << VHOST_NET_F_VIRTIO_NET_HDR;\n+ }\n+\n vhost_ack_features_ex(&net->dev, net->feature_bits, features);\n }\n \n@@ -258,12 +264,9 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)\n if (r < 0) {\n goto fail;\n }\n- net->dev.backend_features = qemu_has_vnet_hdr(options->net_backend)\n- ? 0 : (1ULL << VHOST_NET_F_VIRTIO_NET_HDR);\n net->backend = r;\n net->dev.protocol_features = 0;\n } else {\n- virtio_features_clear(net->dev.backend_features_ex);\n net->dev.protocol_features = 0;\n net->backend = -1;\n \n@@ -284,13 +287,12 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)\n net->dev.features &= ~(1ULL << VIRTIO_NET_F_MRG_RXBUF);\n }\n \n- if (virtio_features_andnot(missing_features,\n- net->dev.backend_features_ex,\n- net->dev.features_ex)) {\n- fprintf(stderr, \"vhost lacks feature mask 0x\" VIRTIO_FEATURES_FMT\n- \" for backend\\n\", VIRTIO_FEATURES_PR(missing_features));\n- goto fail;\n- }\n+ if (!qemu_has_vnet_hdr(options->net_backend) &&\n+ (~net->dev.features & (1ULL << VHOST_NET_F_VIRTIO_NET_HDR))) {\n+ fprintf(stderr, \"vhost lacks feature mask 0x%llx for backend\\n\",\n+ ~net->dev.features & (1ULL << VHOST_NET_F_VIRTIO_NET_HDR));\n+ goto fail;\n+ }\n }\n \n /* Set sane init value. Override when guest acks. */\ndiff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c\nindex 699863cc109..859888fdbaf 100644\n--- a/hw/scsi/vhost-scsi.c\n+++ b/hw/scsi/vhost-scsi.c\n@@ -275,7 +275,6 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp)\n vqs = g_new0(struct vhost_virtqueue, vsc->dev.nvqs);\n vsc->dev.vqs = vqs;\n vsc->dev.vq_index = 0;\n- vsc->dev.backend_features = 0;\n \n ret = vhost_dev_init(&vsc->dev, (void *)(uintptr_t)vhostfd,\n VHOST_BACKEND_TYPE_KERNEL, 0, errp);\ndiff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c\nindex 3612897d4b9..5070178dc28 100644\n--- a/hw/scsi/vhost-user-scsi.c\n+++ b/hw/scsi/vhost-user-scsi.c\n@@ -159,7 +159,6 @@ static int vhost_user_scsi_connect(DeviceState *dev, Error **errp)\n vsc->dev.nvqs = VIRTIO_SCSI_VQ_NUM_FIXED + vs->conf.num_queues;\n vsc->dev.vqs = s->vhost_vqs;\n vsc->dev.vq_index = 0;\n- vsc->dev.backend_features = 0;\n \n ret = vhost_dev_init(&vsc->dev, &s->vhost_user, VHOST_BACKEND_TYPE_USER, 0,\n errp);\ndiff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c\nindex 4532d63653e..06179e402e4 100644\n--- a/hw/virtio/vdpa-dev.c\n+++ b/hw/virtio/vdpa-dev.c\n@@ -104,7 +104,6 @@ static void vhost_vdpa_device_realize(DeviceState *dev, Error **errp)\n v->dev.vqs = vqs;\n v->dev.vq_index = 0;\n v->dev.vq_index_end = v->dev.nvqs;\n- v->dev.backend_features = 0;\n v->started = false;\n \n ret = vhost_vdpa_get_iova_range(v->vhostfd, &iova_range);\ndiff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c\nindex 13c73e7b178..7ce17c5b2d8 100644\n--- a/hw/virtio/vhost-user.c\n+++ b/hw/virtio/vhost-user.c\n@@ -1465,14 +1465,15 @@ static int vhost_user_set_features(struct vhost_dev *dev,\n int ret;\n \n /*\n- * We need to include any extra backend only feature bits that\n- * might be needed by our device. Currently this includes the\n- * VHOST_USER_F_PROTOCOL_FEATURES bit for enabling protocol\n- * features.\n+ * Don't lose VHOST_USER_F_PROTOCOL_FEATURES, which is vhost-user\n+ * specific.\n */\n- ret = vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES,\n- features | dev->backend_features,\n- log_enabled);\n+ if (virtio_has_feature(dev->features, VHOST_USER_F_PROTOCOL_FEATURES)) {\n+ features |= 1ULL << VHOST_USER_F_PROTOCOL_FEATURES;\n+ }\n+\n+ ret = vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES, features,\n+ log_enabled);\n \n if (virtio_has_feature(dev->protocol_features,\n VHOST_USER_PROTOCOL_F_STATUS)) {\n@@ -2192,8 +2193,6 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque,\n (dev->config_ops && dev->config_ops->vhost_dev_config_notifier);\n uint64_t protocol_features;\n \n- dev->backend_features |= 1ULL << VHOST_USER_F_PROTOCOL_FEATURES;\n-\n err = vhost_user_get_u64(dev, VHOST_USER_GET_PROTOCOL_FEATURES,\n &protocol_features);\n if (err < 0) {\ndiff --git a/hw/virtio/virtio-hmp-cmds.c b/hw/virtio/virtio-hmp-cmds.c\nindex 1daae482d37..4bf9a3109d4 100644\n--- a/hw/virtio/virtio-hmp-cmds.c\n+++ b/hw/virtio/virtio-hmp-cmds.c\n@@ -176,8 +176,6 @@ void hmp_virtio_status(Monitor *mon, const QDict *qdict)\n hmp_virtio_dump_features(mon, s->vhost_dev->features);\n monitor_printf(mon, \" Acked features:\\n\");\n hmp_virtio_dump_features(mon, s->vhost_dev->acked_features);\n- monitor_printf(mon, \" Backend features:\\n\");\n- hmp_virtio_dump_features(mon, s->vhost_dev->backend_features);\n monitor_printf(mon, \" Protocol features:\\n\");\n hmp_virtio_dump_protocols(mon, s->vhost_dev->protocol_features);\n }\ndiff --git a/hw/virtio/virtio-qmp.c b/hw/virtio/virtio-qmp.c\nindex f9cdca50d99..71717c56a41 100644\n--- a/hw/virtio/virtio-qmp.c\n+++ b/hw/virtio/virtio-qmp.c\n@@ -710,8 +710,6 @@ VirtioStatus *qmp_x_query_virtio_status(const char *path, Error **errp)\n vdev->guest_features_ex);\n status->host_features = qmp_decode_features(vdev->device_id,\n vdev->host_features_ex);\n- status->backend_features = qmp_decode_features(vdev->device_id,\n- vdev->backend_features_ex);\n \n switch (vdev->device_endian) {\n case VIRTIO_DEVICE_ENDIAN_LITTLE:\n@@ -752,8 +750,6 @@ VirtioStatus *qmp_x_query_virtio_status(const char *path, Error **errp)\n qmp_decode_features(vdev->device_id, hdev->features_ex);\n status->vhost_dev->acked_features =\n qmp_decode_features(vdev->device_id, hdev->acked_features_ex);\n- status->vhost_dev->backend_features =\n- qmp_decode_features(vdev->device_id, hdev->backend_features_ex);\n \n status->vhost_dev->protocol_features =\n qmp_decode_protocols(hdev->protocol_features);\ndiff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h\nindex 3dfec5e15cc..e139e059857 100644\n--- a/include/hw/virtio/vhost.h\n+++ b/include/hw/virtio/vhost.h\n@@ -100,16 +100,9 @@ struct vhost_dev {\n *\n * @features: available features provided by the backend\n * @acked_features: final negotiated features with front-end driver\n- *\n- * @backend_features: this is used in a couple of places to either\n- * store VHOST_USER_F_PROTOCOL_FEATURES to apply to\n- * VHOST_USER_SET_FEATURES or VHOST_NET_F_VIRTIO_NET_HDR. Its\n- * future use should be discouraged and the variable retired as\n- * its easy to confuse with the VirtIO backend_features.\n */\n VIRTIO_DECLARE_FEATURES(features);\n VIRTIO_DECLARE_FEATURES(acked_features);\n- VIRTIO_DECLARE_FEATURES(backend_features);\n \n /**\n * @protocol_features: is the vhost-user only feature set by\ndiff --git a/qapi/virtio.json b/qapi/virtio.json\nindex 09dd0e6d05a..671f1ad793c 100644\n--- a/qapi/virtio.json\n+++ b/qapi/virtio.json\n@@ -85,8 +85,6 @@\n #\n # @acked-features: vhost_dev acked_features\n #\n-# @backend-features: vhost_dev backend_features\n-#\n # @protocol-features: vhost_dev protocol_features\n #\n # @max-queues: vhost_dev max_queues\n@@ -106,7 +104,6 @@\n 'vq-index': 'int',\n 'features': 'VirtioDeviceFeatures',\n 'acked-features': 'VirtioDeviceFeatures',\n- 'backend-features': 'VirtioDeviceFeatures',\n 'protocol-features': 'VhostDeviceProtocols',\n 'max-queues': 'uint64',\n 'backend-cap': 'uint64',\n", "prefixes": [ "v6", "02/22" ] }