qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: zwu.kernel@gmail.com
Cc: pbonzini@redhat.com, Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v5 2/2] net: add the support for -netdev socket, listen
Date: Fri, 8 Jun 2012 11:31:21 +0100	[thread overview]
Message-ID: <CAJSP0QWvr+P=H-3KZ3imt+SRzeOhNFnwJ68-g8U3R86OC6Zgug@mail.gmail.com> (raw)
In-Reply-To: <1339080860-16036-1-git-send-email-zwu.kernel@gmail.com>

On Thu, Jun 7, 2012 at 3:54 PM,  <zwu.kernel@gmail.com> wrote:
> @@ -86,7 +82,16 @@ static void net_socket_send(void *opaque)
>         /* end of connection */
>     eoc:
>         qemu_set_fd_handler(s->fd, NULL, NULL, NULL);
> +        qemu_set_fd_handler(s->listen_fd, net_socket_accept, NULL, s);

What happens when this is not a listen socket?  I suggest setting
listen_fd to -1 during creation and not calling qemu_set_fd_handler()
when listen_fd is -1 here.  If listen_fd is 0 then we'll register
net_socket_accept when standard input becomes ready!

>         closesocket(s->fd);
> +
> +        s->fd = 0;

-1 should be used since 0 is a valid file descriptor (standard input).

Stefan

  reply	other threads:[~2012-06-08 10:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 14:54 [Qemu-devel] [PATCH v5 2/2] net: add the support for -netdev socket, listen zwu.kernel
2012-06-08 10:31 ` Stefan Hajnoczi [this message]
2012-06-08 14:15   ` Zhi Yong Wu
2012-06-08 14:20     ` Stefan Hajnoczi
2012-06-08 14:34       ` Zhi Yong Wu
2012-06-08 14:46       ` Zhi Yong Wu
2012-06-08 14:54   ` Zhi Yong Wu
2012-06-08 15:59     ` Stefan Hajnoczi
2012-06-09  2:09       ` Zhi Yong Wu
2012-06-11  9:01         ` Stefan Hajnoczi

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='CAJSP0QWvr+P=H-3KZ3imt+SRzeOhNFnwJ68-g8U3R86OC6Zgug@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=wuzhy@linux.vnet.ibm.com \
    --cc=zwu.kernel@gmail.com \
    /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).