From: Jason Wang Date: Fri, 19 Apr 2013 07:11:15 +0000 (+0800) Subject: tap: properly initialize vhostfds X-Git-Tag: v1.5.0-rc0~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7873df408dd44eb92840b108211d5aa5db7db526;p=thirdparty%2Fqemu.git 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. Reportyed-by: Michal Privoznik Cc: Michal Privoznik Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang Reviewed-by: Michal Privoznik Signed-off-by: Stefan Hajnoczi --- diff --git a/net/tap.c b/net/tap.c index 17bdf014a90..e0b7a2a5a04 100644 --- a/net/tap.c +++ b/net/tap.c @@ -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;