From nobody Mon Nov 23 05:10:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1790684589; cv=none; d=zohomail.com; s=zohoarc; b=JzLNAhhhXXQtEbrEajn8wd+n1Yq21eDPgAkb0wsHrN1/uAox0//JDbicMVXHVVe4IiQgJX69h1I97AuJD50oShrFBY7oEJRMvGVG3LVI/M9/w7uAV7a+Cmi2ptvAlxOZDNhEPqEKlXoAOE0rJ5dJ2f0Yxi+FbeW69EwZwnEO9+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790684589; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IgjUAYnwy/SQXjg39yLKtps7TVOC7P63qfYaX1pSwGU=; b=jOdxYfuwotueSgbgy3nNby+4JYIj3mPjC7dHTnSh479llt4oZ8m97+RMHUMyYgCPmrPL5iqgmMiTvvHTDO8Zm6VqnsdnzZbdm2l+h/bgASwrJy4PG/qB/cqxaiXTILcXA6Y5+OgnLLg+4+FTiDrDGznmvCALAEkbRvbNdQnOKVw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179068458888920.104724673495298; Tue, 29 Sep 2026 05:23:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBWrG-00043x-0o; Tue, 29 Sep 2026 08:22:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xBWqz-00043O-CB for qemu-devel@nongnu.org; Tue, 29 Sep 2026 08:22:37 -0400 Received: from forwardcorp1a.mail.yandex.net ([178.154.239.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xBWqx-0003gs-56 for qemu-devel@nongnu.org; Tue, 29 Sep 2026 08:22:36 -0400 Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0]) by forwardcorp1a.mail.yandex.net (postfix) with ESMTPS id DD5F0C08EA; Tue, 29 Sep 2026 15:22:31 +0300 (MSK) Received: from dtalexundeer-nx.yandex.net (unknown [2a02:6bf:8080:d49::1:34]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp) with ESMTPSA id NMh0rl1ZOuQ0-pmrbwd9L; Tue, 29 Sep 2026 15:22:31 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1790684551; bh=IgjUAYnwy/SQXjg39yLKtps7TVOC7P63qfYaX1pSwGU=; h=Message-Id:Date:Cc:Subject:To:From; b=UwIsPCOWHaFPzBNsWa/dr3dkPWeM/nrCS1U9mWR1wnYEMGJwEjr8QdNVSE1Z6fvNI rxihlC0PYSc/H+dBzl7hHY9G9PwdzvyTnOS+Kh8h8o7jQL44/pKhyzdojbMpbNK5YO LnlorSvBP6xA4hK95JBl2MhxOmDEJUTTB2H+WLWk= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: Stefano Garzarella , =?UTF-8?q?Cl=C3=A9ment=20Chigot?= , "yc-core @ yandex-team . ru" , "Michael S. Tsirkin" , Alexandr Moshkov Subject: [PATCH v2] vhost: move skip-drain feature check to vhost-user Date: Tue, 29 Sep 2026 17:22:23 +0500 Message-Id: <20260929122223.2164612-1-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=178.154.239.72; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1a.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1790684593480158500 Currently, do_vhost_virtqueue_stop() calls vhost_user_has_protocol_feature(), causing a link failure with --disable-vhost-user when other vhost backends are enabled. Move the assertion to vhost_user_get_vring_base_skip_drain(), keeping the protocol feature check in the vhost-user backend and removing the dependency from the common vhost code. Reported-by: Cl=C3=A9ment Chigot Fixes: 5eb2347867 ("vhost-user: add skip_drain param to do_vhost_virtqueue_= stop") Signed-off-by: Alexandr Moshkov Acked-by: Stefano Garzarella --- v1 -> v2: - Move the protocol feature assertion from do_vhost_virtqueue_stop() to vhost_user_get_vring_base_skip_drain(). - Drop the stub added in v1 and remove the unused vhost-user.h include. hw/virtio/vhost-user.c | 4 +--- hw/virtio/vhost.c | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 65889b0776..84918c7265 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1463,9 +1463,7 @@ static int vhost_user_get_vring_base_skip_drain(struc= t vhost_dev *dev, bool skip_drain_supported =3D vhost_user_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_GET_VRING_BASE_SKIP_D= RAIN); =20 - if (!skip_drain_supported) { - return 0; - } + assert(skip_drain_supported); =20 return get_vring_base(dev, ring, true); } diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 68a8e40481..db8f246137 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -23,7 +23,6 @@ #include "qemu/log.h" #include "standard-headers/linux/vhost_types.h" #include "hw/virtio/virtio-bus.h" -#include "hw/virtio/vhost-user.h" #include "hw/mem/memory-device.h" #include "migration/blocker.h" #include "migration/qemu-file-types.h" @@ -1503,10 +1502,6 @@ static int do_vhost_virtqueue_stop(struct vhost_dev = *dev, unsigned idx, bool force, bool skip_drain) { - if (skip_drain) { - assert(vhost_user_has_protocol_feature(dev, - VHOST_USER_PROTOCOL_F_GET_VRING_BASE_SKIP_DRAIN)); - } int vhost_vq_index =3D dev->vhost_ops->vhost_get_vq_index(dev, idx); struct vhost_vring_state state =3D { .index =3D vhost_vq_index, --=20 2.34.1