]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tap: properly initialize vhostfds
authorJason Wang <jasowang@redhat.com>
Fri, 19 Apr 2013 07:11:15 +0000 (15:11 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 13 May 2013 16:52:06 +0000 (11:52 -0500)
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 <mprivozn@redhat.com>
Cc: Michal Privoznik <mprivozn@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 7873df408dd44eb92840b108211d5aa5db7db526)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
net/tap.c

index daab350efcd3b5966039a50da940e6e7985ab6b5..0da48b16fbdee466236ce001ceab38c245f7ed92 100644 (file)
--- a/net/tap.c
+++ b/net/tap.c
@@ -628,7 +628,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;