tap: properly initialize vhostfds
PATCH 1/1 tap: properly initialize vhostfds
Only tap->vhostfd were checked net_init_tap_one(), but tap->vhostfds were forgot, this will lead qemu to ignore all fds passed by management through vhostfds, and tries to create vhost_net device itself. Fix by adding this check also.
--- net/tap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/tap.c +1 -1
@@ -623,7 +623,7 @@ static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, vhostfdname || (tap->has_vhostforce && tap->vhostforce)) {int vhostfd; -if (tap->has_vhostfd) { +if (tap->has_vhostfd || tap->has_vhostfds) { vhostfd =monitor_handle_fd_param (cur_mon, vhostfdname);if (vhostfd ==-1 ) {return -1 ;
Signature · 1 line
1.7.1
Quoted 6 lines · Jason Wang
Only
tap->vhostfdwere checkednet_init_tap_one(), buttap->vhostfdswere forgot, this will lead qemu to ignore all fds passed by management through vhostfds, and tries to createvhost_netdevice itself. Fix by adding this check also.Reportyed-by Michal Privoznik <[email protected]>
Typo
Quoted 13 lines
Cc Michal Privoznik <[email protected]>Signed-off-by Jason Wang <[email protected]>--- net/tap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)net/tap.c +0
-0
net/tap.c static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, · line 629
Quoted 8 lines
net/tap.c +1
-1@@ -623,7 +623,7 @@ static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, vhostfdname || (tap->has_vhostforce && tap->vhostforce)) {int vhostfd; -if (tap->has_vhostfd) { +if (tap->has_vhostfd || tap->has_vhostfds) { vhostfd =monitor_handle_fd_param (cur_mon, vhostfdname);if (vhostfd ==-1 ) {return -1 ;
Yup. I can confirm this fixes the problem for me.
Michal
Stefan Hajnoczi
AppliedQuoted 5 lines · Jason Wang
Only
tap->vhostfdwere checkednet_init_tap_one(), buttap->vhostfdswere forgot, this will lead qemu to ignore all fds passed by management through vhostfds, and tries to createvhost_netdevice itself. Fix by adding this check also.
Quoted 7 lines
Reportyed-by Michal Privoznik <[email protected]>Cc Michal Privoznik <[email protected]>Signed-off-by Jason Wang <[email protected]>--- net/tap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Thanks, applied to my net tree:
https://github.com/stefanha/qemu/commits/net
Stefan