From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsDDn-0007ns-Rm for qemu-devel@nongnu.org; Fri, 20 Jul 2012 09:26:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SsDDj-0004Aq-DG for qemu-devel@nongnu.org; Fri, 20 Jul 2012 09:26:19 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:38155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsDDj-0004Ae-4K for qemu-devel@nongnu.org; Fri, 20 Jul 2012 09:26:15 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Jul 2012 14:26:13 +0100 Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6KDQBQI2871526 for ; Fri, 20 Jul 2012 14:26:11 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6KDQAQO005406 for ; Fri, 20 Jul 2012 07:26:11 -0600 From: Stefan Hajnoczi Date: Fri, 20 Jul 2012 14:25:51 +0100 Message-Id: <1342790753-12727-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 0/2] net: Make -netdev socket,listen= work List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 . 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