]> git.ipfire.org Git - thirdparty/qemu.git/commit
net: Add is_vhost_user flag to vhost_net struct
authorLaurent Vivier <lvivier@redhat.com>
Wed, 9 Jul 2025 08:24:23 +0000 (10:24 +0200)
committerJason Wang <jasowang@redhat.com>
Mon, 14 Jul 2025 05:27:09 +0000 (13:27 +0800)
commitba5acc5d6e0bc9ab86619c92cb76493aa197d7a2
tree76b6de340e1e03227643eee9ecd3a436883b6d05
parent33b78a30a3e8e1cf16ef423bf2e78caf3d560985
net: Add is_vhost_user flag to vhost_net struct

Introduce a boolean is_vhost_user field to the vhost_net
structure. This flag is initialized during vhost_net_init based
on whether the backend is vhost-user.

This refactoring simplifies checks for vhost-user specific behavior,
replacing direct comparisons of 'net->nc->info->type' with the new
flag. It improves readability and encapsulates the backend type
information directly within the vhost_net instance.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/vhost_net.c
hw/net/virtio-net.c
include/hw/virtio/vhost.h
include/net/vhost_net.h
net/tap.c
net/vhost-user.c
net/vhost-vdpa.c