qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tap: properly initialize vhostfds
@ 2013-04-19  7:11 Jason Wang
  2013-04-19 11:24 ` Michal Privoznik
  2013-04-22 12:45 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Jason Wang @ 2013-04-19  7:11 UTC (permalink / raw)
  To: aliguori, stefanha, qemu-devel; +Cc: Michal Privoznik, Jason Wang, qemu-stable

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>
---
 net/tap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index 17bdf01..e0b7a2a 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;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] tap: properly initialize vhostfds
  2013-04-19  7:11 [Qemu-devel] [PATCH] tap: properly initialize vhostfds Jason Wang
@ 2013-04-19 11:24 ` Michal Privoznik
  2013-04-22 12:45 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Privoznik @ 2013-04-19 11:24 UTC (permalink / raw)
  To: Jason Wang; +Cc: aliguori, qemu-devel, stefanha, qemu-stable

On 19.04.2013 09:11, Jason Wang wrote:
> 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>

Typo

> Cc: Michal Privoznik <mprivozn@redhat.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  net/tap.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/tap.c b/net/tap.c
> index 17bdf01..e0b7a2a 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;
> 

Yup. I can confirm this fixes the problem for me.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] tap: properly initialize vhostfds
  2013-04-19  7:11 [Qemu-devel] [PATCH] tap: properly initialize vhostfds Jason Wang
  2013-04-19 11:24 ` Michal Privoznik
@ 2013-04-22 12:45 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-04-22 12:45 UTC (permalink / raw)
  To: Jason Wang; +Cc: Michal Privoznik, aliguori, qemu-devel, stefanha, qemu-stable

On Fri, Apr 19, 2013 at 03:11:15PM +0800, Jason Wang wrote:
> 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>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-22 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-19  7:11 [Qemu-devel] [PATCH] tap: properly initialize vhostfds Jason Wang
2013-04-19 11:24 ` Michal Privoznik
2013-04-22 12:45 ` Stefan Hajnoczi

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).