[RFC 1/5] net/filter: Allow redirector on vhost backends

Cindy Lu posted 5 patches 1 month, 3 weeks ago
There is a newer version of this series
[RFC 1/5] net/filter: Allow redirector on vhost backends
Posted by Cindy Lu 1 month, 3 weeks ago
Allow filter redirector on vhost backends

Signed-off-by: Cindy Lu <lulu@redhat.com>
---
 net/filter.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/filter.c b/net/filter.c
index 76345c1a9d..bbede6b085 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -255,8 +255,10 @@ static void netfilter_complete(UserCreatable *uc, Error **errp)
     }
 
     if (get_vhost_net(ncs[0])) {
-        error_setg(errp, "Vhost is not supported");
-        return;
+        if (!object_dynamic_cast(OBJECT(uc), "filter-redirector")) {
+            error_setg(errp, "Vhost is not supported");
+            return;
+        }
     }
 
     if (strcmp(nf->position, "head") && strcmp(nf->position, "tail")) {
-- 
2.52.0
Re: [RFC 1/5] net/filter: Allow redirector on vhost backends
Posted by Jason Wang 1 month, 1 week ago
On Fri, Feb 13, 2026 at 3:10 PM Cindy Lu <lulu@redhat.com> wrote:
>
> Allow filter redirector on vhost backends

This can't work for all type of netfilter I believe unless we
implemeting a general shadow virtqueue etc.

>
> Signed-off-by: Cindy Lu <lulu@redhat.com>
> ---
>  net/filter.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/filter.c b/net/filter.c
> index 76345c1a9d..bbede6b085 100644
> --- a/net/filter.c
> +++ b/net/filter.c
> @@ -255,8 +255,10 @@ static void netfilter_complete(UserCreatable *uc, Error **errp)
>      }
>
>      if (get_vhost_net(ncs[0])) {
> -        error_setg(errp, "Vhost is not supported");
> -        return;
> +        if (!object_dynamic_cast(OBJECT(uc), "filter-redirector")) {
> +            error_setg(errp, "Vhost is not supported");
> +            return;
> +        }
>      }
>
>      if (strcmp(nf->position, "head") && strcmp(nf->position, "tail")) {
> --
> 2.52.0

Thanks

>