From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
To: mst@redhat.com
Cc: qemu-devel@nongnu.org, philmd@linaro.org, thuth@redhat.com,
eblake@redhat.com, michael.roth@amd.com, armbru@redhat.com,
farosas@suse.de, peterx@redhat.com, berrange@redhat.com,
jasowang@redhat.com, steven.sistare@oracle.com,
leiyang@redhat.com, davydov-max@yandex-team.ru,
yc-core@yandex-team.ru, vsementsov@yandex-team.ru
Subject: [PATCH v6 04/19] net/tap: pass NULL to net_init_tap_one() in cases when scripts are NULL
Date: Tue, 23 Sep 2025 13:00:55 +0300 [thread overview]
Message-ID: <20250923100110.70862-5-vsementsov@yandex-team.ru> (raw)
In-Reply-To: <20250923100110.70862-1-vsementsov@yandex-team.ru>
Directly pass NULL in cases where we report an error if script or
downscript are set.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
net/tap.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index 506dc9d226..e42c7ca044 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -787,8 +787,6 @@ int net_init_tap(const Netdev *netdev, const char *name,
const NetdevTapOptions *tap;
int fd, vnet_hdr = 0, i = 0, queues;
/* for the no-fd, no-helper case */
- const char *script;
- const char *downscript;
Error *err = NULL;
const char *vhostfdname;
char ifname[128];
@@ -798,8 +796,6 @@ int net_init_tap(const Netdev *netdev, const char *name,
tap = &netdev->u.tap;
queues = tap->has_queues ? tap->queues : 1;
vhostfdname = tap->vhostfd;
- script = tap->script;
- downscript = tap->downscript;
/* QEMU hubs do not support multiqueue tap, in this case peer is set.
* For -netdev, peer is always NULL. */
@@ -840,7 +836,7 @@ int net_init_tap(const Netdev *netdev, const char *name,
}
net_init_tap_one(tap, peer, "tap", name, NULL,
- script, downscript,
+ NULL, NULL,
vhostfdname, vnet_hdr, fd, &err);
if (err) {
error_propagate(errp, err);
@@ -901,7 +897,7 @@ int net_init_tap(const Netdev *netdev, const char *name,
}
net_init_tap_one(tap, peer, "tap", name, ifname,
- script, downscript,
+ NULL, NULL,
tap->vhostfds ? vhost_fds[i] : NULL,
vnet_hdr, fd, &err);
if (err) {
@@ -946,7 +942,7 @@ free_fail:
}
net_init_tap_one(tap, peer, "bridge", name, ifname,
- script, downscript, vhostfdname,
+ NULL, NULL, vhostfdname,
vnet_hdr, fd, &err);
if (err) {
error_propagate(errp, err);
@@ -954,6 +950,8 @@ free_fail:
return -1;
}
} else {
+ const char *script = tap->script;
+ const char *downscript = tap->downscript;
g_autofree char *default_script = NULL;
g_autofree char *default_downscript = NULL;
bool vnet_hdr_required = tap->has_vnet_hdr && tap->vnet_hdr;
--
2.48.1
next prev parent reply other threads:[~2025-09-23 10:03 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 10:00 [PATCH v6 00/19] virtio-net: live-TAP local migration Vladimir Sementsov-Ogievskiy
2025-09-23 10:00 ` [PATCH v6 01/19] net/tap: net_init_tap_one(): drop extra error propagation Vladimir Sementsov-Ogievskiy
2025-09-23 10:00 ` [PATCH v6 02/19] net/tap: net_init_tap_one(): move parameter checking earlier Vladimir Sementsov-Ogievskiy
2025-09-23 10:00 ` [PATCH v6 03/19] net/tap: rework net_tap_init() Vladimir Sementsov-Ogievskiy
2025-09-23 10:00 ` Vladimir Sementsov-Ogievskiy [this message]
2025-09-23 10:00 ` [PATCH v6 05/19] net/tap: rework scripts handling Vladimir Sementsov-Ogievskiy
2025-09-23 10:39 ` Vladimir Sementsov-Ogievskiy
2025-09-23 10:00 ` [PATCH v6 06/19] net/tap: setup exit notifier only when needed Vladimir Sementsov-Ogievskiy
2025-09-23 10:00 ` [PATCH v6 07/19] net/tap: split net_tap_fd_init() Vladimir Sementsov-Ogievskiy
2025-09-23 10:00 ` [PATCH v6 08/19] net/tap: tap_set_sndbuf(): add return value Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 09/19] net/tap: rework tap_set_sndbuf() Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 10/19] net/tap: rework sndbuf handling Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 11/19] net/tap: introduce net_tap_setup() Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 12/19] net/tap: move vhost fd initialization to net_tap_new() Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 13/19] net/tap: finalize net_tap_set_fd() logic Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 14/19] migration: add MIG_EVENT_PRE_INCOMING Vladimir Sementsov-Ogievskiy
2025-09-30 19:25 ` Peter Xu
2025-09-23 10:01 ` [PATCH v6 15/19] net/tap: postpone tap setup to pre-incoming Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 16/19] qapi: add interface for backend-transfer virtio-net/tap migration Vladimir Sementsov-Ogievskiy
2025-10-06 13:23 ` Markus Armbruster
2025-10-06 13:33 ` Michael S. Tsirkin
2025-10-06 14:38 ` Markus Armbruster
2025-10-06 14:55 ` Michael S. Tsirkin
2025-10-06 17:06 ` Markus Armbruster
2025-10-07 8:57 ` Vladimir Sementsov-Ogievskiy
2025-10-07 11:42 ` Markus Armbruster
2025-09-23 10:01 ` [PATCH v6 17/19] virtio-net: support backend-transfer migration for virtio-net/tap Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 18/19] tests/functional: add skipWithoutSudo() decorator Vladimir Sementsov-Ogievskiy
2025-09-23 10:01 ` [PATCH v6 19/19] tests/functional: add test_x86_64_tap_migration Vladimir Sementsov-Ogievskiy
2025-09-24 8:02 ` [PATCH v6 00/19] virtio-net: live-TAP local migration Lei Yang
2025-10-01 16:33 ` Maksim Davydov
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=20250923100110.70862-5-vsementsov@yandex-team.ru \
--to=vsementsov@yandex-team.ru \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=davydov-max@yandex-team.ru \
--cc=eblake@redhat.com \
--cc=farosas@suse.de \
--cc=jasowang@redhat.com \
--cc=leiyang@redhat.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=steven.sistare@oracle.com \
--cc=thuth@redhat.com \
--cc=yc-core@yandex-team.ru \
/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).