From nobody Tue Apr 7 19:40:29 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1773299764; cv=none; d=zohomail.com; s=zohoarc; b=E1KQWyD/Bf+T4XAjP1EXkwCCAUoxnmiB6OduhPGOMpaO15JJ5Np430paihEdUQ96tDz/DTWEPbV/aNinHLUvLYjbhHghmZwbaXEF1J1QCwKleFX5xpnCZyE0A+Z3PL4/bR6OI/+2aRd7eeJ72zsPmZK0sJd5ho/ySBNX2HIHdio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773299764; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=JZaFMGlDzOF4JQOTYPrBkznSs7aelIBgPXoOpxZ186U=; b=fDeM8PkdebJbMNU4v75Me1VBFGYRkB3+gHmGJgC/8a0Sram7PO8bKh9oLb6SL/+RsdPgwan2vA/1j65xUu+hHfoZ/1iOZGwcQnR2B1DBOWn2PZbCxMZbxhBdw+BLRzeHquAm9yrIv1TltRQ6VURxmYId2HVmYpqsY9vCRa6c/k0= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773299764025880.2280194241162; Thu, 12 Mar 2026 00:16:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0aFl-0004WU-2D; Thu, 12 Mar 2026 03:14:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0aFj-0004WK-PC for qemu-devel@nongnu.org; Thu, 12 Mar 2026 03:14:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0aFi-0008F8-4C for qemu-devel@nongnu.org; Thu, 12 Mar 2026 03:14:39 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-281-Fguhd8W3Poeg38Qs_jKU_g-1; Thu, 12 Mar 2026 03:14:34 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3861518002C9; Thu, 12 Mar 2026 07:14:33 +0000 (UTC) Received: from S2.redhat.com (unknown [10.72.112.170]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C116C1800361; Thu, 12 Mar 2026 07:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773299677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JZaFMGlDzOF4JQOTYPrBkznSs7aelIBgPXoOpxZ186U=; b=R54ERMrl+ksaVbYtC0ZUy7bpAal3gdmAV1NZ84cLH9j34O/ud2E/AtujVR0qxsEcky8YjG ADxaSoir0xeB6CAHMKqCANyHZ4OZ2AMzKSI2nU4rxZ6MBFIRD5OIjXjX4C8d4cjf89MIB4 EpaUzJoPex/K+ZBpb4nR/lbN9jtIqJ0= X-MC-Unique: Fguhd8W3Poeg38Qs_jKU_g-1 X-Mimecast-MFC-AGG-ID: Fguhd8W3Poeg38Qs_jKU_g_1773299673 From: Cindy Lu To: lulu@redhat.com, mst@redhat.com, jasowang@redhat.com, zhangckid@gmail.com, lizhijian@fujitsu.com, jmarcin@redhat.com, qemu-devel@nongnu.org Subject: [RFC v2 1/9] net/filter: allow redirector on vhost TAP backends Date: Thu, 12 Mar 2026 15:09:29 +0800 Message-ID: <20260312071415.1836655-2-lulu@redhat.com> In-Reply-To: <20260312071415.1836655-1-lulu@redhat.com> References: <20260312071415.1836655-1-lulu@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=lulu@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list 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 @redhat.com) X-ZM-MESSAGEID: 1773299765273154100 Content-Type: text/plain; charset="utf-8" netfilter_complete() currently rejects every filter attached to a vhost-backed netdev. That prevents filter-redirector from being used on the TAP backends that handle switchover capture and replay. Permit filter-redirector on vhost-backed TAP netdevs, but keep the gate narrow: other filters are still rejected and non-TAP backends remain unsupported. Later commits can widen the filter set without duplicating the backend restriction. Signed-off-by: Cindy Lu --- net/filter.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/net/filter.c b/net/filter.c index 76345c1a9d..b9646b9e00 100644 --- a/net/filter.c +++ b/net/filter.c @@ -255,8 +255,19 @@ static void netfilter_complete(UserCreatable *uc, Erro= r **errp) } =20 if (get_vhost_net(ncs[0])) { - error_setg(errp, "Vhost is not supported"); - return; + bool redirector =3D object_dynamic_cast(OBJECT(uc), + "filter-redirector"); + bool buffer =3D object_dynamic_cast(OBJECT(uc), "filter-buffer"); + bool vhost_filter =3D redirector || buffer; + + if (!redirector) { + error_setg(errp, "Vhost is not supported"); + return; + } + if (vhost_filter && ncs[0]->info->type !=3D NET_CLIENT_DRIVER_TAP)= { + error_setg(errp, "Vhost filter support requires a TAP backend"= ); + return; + } } =20 if (strcmp(nf->position, "head") && strcmp(nf->position, "tail")) { --=20 2.52.0