qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhi Yong Wu <zwu.kernel@gmail.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v2] net: add the support for -netdev socket, listen
Date: Mon, 28 May 2012 15:49:11 +0800	[thread overview]
Message-ID: <CAEH94LjPJ5V9SfYsrvicyw4cgz_u04tsEaH-42qQ5XHcdw6GnA@mail.gmail.com> (raw)
In-Reply-To: <CAJSP0QXWBoYLD6C22vYZnwt=7+_x2xzayYn+rC3t+aDppK=t=g@mail.gmail.com>

On Sun, Feb 26, 2012 at 10:48 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Sat, Feb 18, 2012 at 9:19 AM,  <zwu.kernel@gmail.com> wrote:
>> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
>>
>> The -net socket,listen option does not work with the newer -netdev
>> syntax:
>> http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg01508.html
>>
>> This patch makes it work now.
>>
>> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
>> ---
>>  net.c        |   26 +++++++++++++++++++++
>>  net.h        |    2 +
>>  net/socket.c |   72 +++++++++++++++++++++++++++++++++++++++++++++-------------
>>  3 files changed, 84 insertions(+), 16 deletions(-)
>
> I wanted to understand the problem better so I tried out -net
> socket,listen=.  Here is its behavior:
>
> 1. A client can connect to QEMU, this creates a new socket
> VLANClientState on the VLAN.
> 2. If another client connects to QEMU, another VLANClientState is
> created.  That means many socket clients can be added to the same
> "VLAN".
> 3. When a simple TCP client like netcat connects and then disconnects,
> the VLANClientState remains forever.  There seems to be no cleanup.
>
> This patch does not handle the -net socket,listen= case where multiple
> clients connect.
>
> Also, the -netdev socket,listen= semantics cannot match -net
> socket-listen= semantics because there is only one peer at any time.
> Some options:
>
> 1. Do not accept new connections while a client is connected.  Once
> the client disconnects we can accept a new connection.  This maintains
> the 1-1 peer behavior.
> 2. Integrate with vlan-hub so that multiple clients can connect even
> with -netdev.  Connections will create new NetClientStates and
> auto-attach to the hub.  This mimics -net socket,listen= but requires
> a hub to be used.
> 3. Forbid -netdev socket,listen=, only allow -net socket,listen=.
>
> I think #1 would be okay, although it no longer allows multiple
> connections, but I don't have a strong opinion either way.
Now i prefer to support #2. Do you think of it? Should the usage
"-netdev socket,listen" also been supported or forbidden? As you said,
-netdev only has one peer, so their usage will be a bit different.

>
> Stefan



-- 
Regards,

Zhi Yong Wu

  parent reply	other threads:[~2012-05-28  7:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-18  9:19 [Qemu-devel] [PATCH v2] net: add the support for -netdev socket, listen zwu.kernel
2012-02-24 15:05 ` Anthony Liguori
2012-02-24 16:50   ` Zhi Yong Wu
2012-02-24 17:00   ` Zhi Yong Wu
2012-02-26 14:48 ` Stefan Hajnoczi
2012-02-27  7:28   ` Zhi Yong Wu
2012-05-28  7:49   ` Zhi Yong Wu [this message]
2012-05-28 10:51     ` Stefan Hajnoczi
2012-05-28 13:13       ` Zhi Yong Wu
2012-06-03 14:35   ` Zhi Yong Wu

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=CAEH94LjPJ5V9SfYsrvicyw4cgz_u04tsEaH-42qQ5XHcdw6GnA@mail.gmail.com \
    --to=zwu.kernel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=wuzhy@linux.vnet.ibm.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).