qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>, Jason Wang <jasowang@redhat.com>
Subject: [PULL V2 05/16] vhost_net: Rename vhost_set_vring_enable() for clarity
Date: Tue, 15 Jul 2025 12:35:13 +0800	[thread overview]
Message-ID: <20250715043524.21719-6-jasowang@redhat.com> (raw)
In-Reply-To: <20250715043524.21719-1-jasowang@redhat.com>

From: Laurent Vivier <lvivier@redhat.com>

This is a cosmetic change with no functional impact.

The function vhost_set_vring_enable() is specific to vhost_net and
is used outside of vhost_net.c (specifically, in
hw/net/virtio-net.c). To prevent confusion with other similarly named
vhost functions, such as the one found in cryptodev-vhost.c, it has
been renamed to vhost_net_set_vring_enable(). This clarifies that the
function belongs to the vhost_net module.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/vhost_net-stub.c | 2 +-
 hw/net/vhost_net.c      | 4 ++--
 hw/net/virtio-net.c     | 4 ++--
 include/net/vhost_net.h | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/net/vhost_net-stub.c b/hw/net/vhost_net-stub.c
index 72df6d757e..7bed0bf92b 100644
--- a/hw/net/vhost_net-stub.c
+++ b/hw/net/vhost_net-stub.c
@@ -101,7 +101,7 @@ VHostNetState *get_vhost_net(NetClientState *nc)
     return 0;
 }
 
-int vhost_set_vring_enable(NetClientState *nc, int enable)
+int vhost_net_set_vring_enable(NetClientState *nc, int enable)
 {
     return 0;
 }
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 891f235a0a..cb87056397 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -551,7 +551,7 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
 
         if (peer->vring_enable) {
             /* restore vring enable state */
-            r = vhost_set_vring_enable(peer, peer->vring_enable);
+            r = vhost_net_set_vring_enable(peer, peer->vring_enable);
 
             if (r < 0) {
                 goto err_guest_notifiers;
@@ -686,7 +686,7 @@ VHostNetState *get_vhost_net(NetClientState *nc)
     return vhost_net;
 }
 
-int vhost_set_vring_enable(NetClientState *nc, int enable)
+int vhost_net_set_vring_enable(NetClientState *nc, int enable)
 {
     VHostNetState *net = get_vhost_net(nc);
     const VhostOps *vhost_ops = net->dev.vhost_ops;
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 351377c025..e3400f18c8 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -697,7 +697,7 @@ static int peer_attach(VirtIONet *n, int index)
     }
 
     if (nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_USER) {
-        vhost_set_vring_enable(nc->peer, 1);
+        vhost_net_set_vring_enable(nc->peer, 1);
     }
 
     if (nc->peer->info->type != NET_CLIENT_DRIVER_TAP) {
@@ -720,7 +720,7 @@ static int peer_detach(VirtIONet *n, int index)
     }
 
     if (nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_USER) {
-        vhost_set_vring_enable(nc->peer, 0);
+        vhost_net_set_vring_enable(nc->peer, 0);
     }
 
     if (nc->peer->info->type !=  NET_CLIENT_DRIVER_TAP) {
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index c6a5361a2a..0f40049f34 100644
--- a/include/net/vhost_net.h
+++ b/include/net/vhost_net.h
@@ -41,7 +41,7 @@ void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mask);
 int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr);
 VHostNetState *get_vhost_net(NetClientState *nc);
 
-int vhost_set_vring_enable(NetClientState * nc, int enable);
+int vhost_net_set_vring_enable(NetClientState *nc, int enable);
 
 uint64_t vhost_net_get_acked_features(VHostNetState *net);
 
-- 
2.42.0



  parent reply	other threads:[~2025-07-15  4:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15  4:35 [PULL V2 00/16] Net patches Jason Wang
2025-07-15  4:35 ` [PULL V2 01/16] net: fix buffer overflow in af_xdp_umem_create() Jason Wang
2025-07-15  4:35 ` [PULL V2 02/16] virtio-net: Add queues for RSS during migration Jason Wang
2025-07-15  4:35 ` [PULL V2 03/16] net: Refactor stream logic for reuse in '-net passt' Jason Wang
2025-07-15  4:35 ` [PULL V2 04/16] net: Define net_client_set_link() Jason Wang
2025-07-15  4:35 ` Jason Wang [this message]
2025-07-15  4:35 ` [PULL V2 06/16] net: Add get_vhost_net callback to NetClientInfo Jason Wang
2025-07-15  4:35 ` [PULL V2 07/16] net: Consolidate vhost feature bits into vhost_net structure Jason Wang
2025-07-15  4:35 ` [PULL V2 08/16] net: Add get_acked_features callback to VhostNetOptions Jason Wang
2025-07-15  4:35 ` [PULL V2 09/16] net: Add save_acked_features callback to vhost_net Jason Wang
2025-07-15  4:35 ` [PULL V2 10/16] net: Allow network backends to advertise max TX queue size Jason Wang
2025-07-15  4:35 ` [PULL V2 11/16] net: Add is_vhost_user flag to vhost_net struct Jason Wang
2025-07-15  4:35 ` [PULL V2 12/16] net: Add passt network backend Jason Wang
2025-07-17  9:28   ` Peter Maydell
2025-07-17 11:12     ` Laurent Vivier
2025-07-15  4:35 ` [PULL V2 13/16] net/passt: Implement vhost-user backend support Jason Wang
2025-07-17  9:32   ` Peter Maydell
2025-07-15  4:35 ` [PULL V2 14/16] net/af-xdp: Remove XDP program cleanup logic Jason Wang
2025-07-15  4:35 ` [PULL V2 15/16] net/af-xdp: Fix up cleanup path upon failure in queue creation Jason Wang
2025-07-15  4:35 ` [PULL V2 16/16] net/af-xdp: Support pinned map path for AF_XDP sockets Jason Wang
2025-07-16 12:39 ` [PULL V2 00/16] Net patches Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250715043524.21719-6-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).