All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH 0/2] net: Make -netdev socket,listen= work
@ 2012-07-31 11:41 Laszlo Ersek
  2012-07-31 13:04 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2012-07-31 11:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Zhi Yong Wu

(in reply to
<http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg02637.html> --
In-Reply-To set, but that may not be enough for the web archive)

Looks good to me. A minor nit: 2/2 keeps the close(s->fd) call (instead
of calling closesocket(s->fd), like in eoc handling) in
net_socket_cleanup().

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

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

* Re: [Qemu-devel] [PATCH 0/2] net: Make -netdev socket,listen= work
  2012-07-31 11:41 [Qemu-devel] [PATCH 0/2] net: Make -netdev socket,listen= work Laszlo Ersek
@ 2012-07-31 13:04 ` Stefan Hajnoczi
  2012-07-31 14:20   ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-07-31 13:04 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: Zhi Yong Wu, qemu-devel, Stefan Hajnoczi

On Tue, Jul 31, 2012 at 12:41 PM, Laszlo Ersek <lersek@redhat.com> wrote:
> (in reply to
> <http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg02637.html> --
> In-Reply-To set, but that may not be enough for the web archive)
>
> Looks good to me. A minor nit: 2/2 keeps the close(s->fd) call (instead
> of calling closesocket(s->fd), like in eoc handling) in
> net_socket_cleanup().

The reason I didn't change close(2) to closesocket() is because
-netdev socket,fd= can pass arbitrary file descriptors.  I suspect
only real socket objects will work but we basically don't know what
the passed file descriptor is.  This is the reason why I didn't feel
100% happy converting it to closesocket().

> Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks!

Stefan

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

* Re: [Qemu-devel] [PATCH 0/2] net: Make -netdev socket,listen= work
  2012-07-31 13:04 ` Stefan Hajnoczi
@ 2012-07-31 14:20   ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2012-07-31 14:20 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Laszlo Ersek, qemu-devel, Stefan Hajnoczi, Zhi Yong Wu

Il 31/07/2012 15:04, Stefan Hajnoczi ha scritto:
>> > Looks good to me. A minor nit: 2/2 keeps the close(s->fd) call (instead
>> > of calling closesocket(s->fd), like in eoc handling) in
>> > net_socket_cleanup().
> The reason I didn't change close(2) to closesocket() is because
> -netdev socket,fd= can pass arbitrary file descriptors.  I suspect
> only real socket objects will work but we basically don't know what
> the passed file descriptor is.  This is the reason why I didn't feel
> 100% happy converting it to closesocket().
> 

-netdev socket,fd= is probably not usable from Windows, so no problem
using close().

Paolo

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

* Re: [Qemu-devel] [PATCH 0/2] net: Make -netdev socket,listen= work
  2012-07-20 13:25 Stefan Hajnoczi
@ 2012-07-31 13:31 ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-07-31 13:31 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Zhi Yong Wu

On Fri, Jul 20, 2012 at 2:25 PM, Stefan Hajnoczi
<stefanha@linux.vnet.ibm.com> wrote:
> The socket backend does not support the listen= option with -netdev.  The
> problem is how the socket NetClientState lifecycle is implemented: the socket
> backend waits for an incoming client connection before creating a
> NetClientState.  The guest -device wants a peer= on startup, so QEMU fails with
> an error about the non-existent peer.
>
> This series makes -netdev socket,listen= work by creating the NetClientState
> right away.  This allows -device peer= to find the socket backend.
>
> This code was written by Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>.  I have only
> cleaned up and tested it.  The following work:
>  * -net socket,listen=:1234 -net nic,model=virtio
>  * -netdev socket,listen=:1234,id=netdev0 -device virtio-net-pci,netdev=netdev0
>
> Zhi Yong Wu (2):
>   net: fix the coding style
>   net: add the support for -netdev socket, listen
>
>  net/socket.c |   82 +++++++++++++++++++++++++++++++++++-----------------------
>  1 file changed, 50 insertions(+), 32 deletions(-)

Merged into the net tree:
https://github.com/stefanha/qemu/tree/net

Stefan

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

* [Qemu-devel] [PATCH 0/2] net: Make -netdev socket,listen= work
@ 2012-07-20 13:25 Stefan Hajnoczi
  2012-07-31 13:31 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-07-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Zhi Yong Wu

The socket backend does not support the listen= option with -netdev.  The
problem is how the socket NetClientState lifecycle is implemented: the socket
backend waits for an incoming client connection before creating a
NetClientState.  The guest -device wants a peer= on startup, so QEMU fails with
an error about the non-existent peer.

This series makes -netdev socket,listen= work by creating the NetClientState
right away.  This allows -device peer= to find the socket backend.

This code was written by Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>.  I have only
cleaned up and tested it.  The following work:
 * -net socket,listen=:1234 -net nic,model=virtio
 * -netdev socket,listen=:1234,id=netdev0 -device virtio-net-pci,netdev=netdev0

Zhi Yong Wu (2):
  net: fix the coding style
  net: add the support for -netdev socket, listen

 net/socket.c |   82 +++++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 50 insertions(+), 32 deletions(-)

-- 
1.7.10.4

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

end of thread, other threads:[~2012-07-31 14:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 11:41 [Qemu-devel] [PATCH 0/2] net: Make -netdev socket,listen= work Laszlo Ersek
2012-07-31 13:04 ` Stefan Hajnoczi
2012-07-31 14:20   ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2012-07-20 13:25 Stefan Hajnoczi
2012-07-31 13:31 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.