On 03.09.25 08:36, Jason Wang wrote:
On Sun, Aug 24, 2025 at 12:03 AM Vladimir Sementsov-Ogievskiy
<[email protected]> wrote:

net_tap_init() is used in one place. Let's move net_init_tap_one()
call to it and simplify outer loop code.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
  net/tap.c | 54 +++++++++++++++++++++++++++++++-----------------------
  1 file changed, 31 insertions(+), 23 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index 83a1c9250a..57939ed16f 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -674,31 +674,37 @@ int net_init_bridge(const Netdev *netdev, const char 
*name,
      return 0;
  }

-static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr,
-                        const char *setup_script, char *ifname,
-                        size_t ifname_sz, int mq_required, Error **errp)
+static int net_tap_open_one(const Netdev *netdev,
+                            const char *name, NetClientState *peer,
+                            const char *script, const char *downscript,

I'd stick to "setup_script" as we have "downscript".

I decided to rename, because in other places the variable is called script, and 
the original option is also script=.

It would be more correct to rename in a separate commit. I can do this in v2, 
or just add a not to commit message here.


And we can save several lines of changes.

The rest looks good.

Thanks


Thank you for reviewing!


--
Best regards,
Vladimir

Reply via email to