From patchwork Thu Nov 1 11:10:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 196162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BA68C2C034D for ; Thu, 1 Nov 2012 22:14:19 +1100 (EST) Received: from localhost ([::1]:33353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTsj3-0006bf-Qq for incoming@patchwork.ozlabs.org; Thu, 01 Nov 2012 07:14:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTsiw-0006bV-Qm for qemu-devel@nongnu.org; Thu, 01 Nov 2012 07:14:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTsis-0008Vv-0W for qemu-devel@nongnu.org; Thu, 01 Nov 2012 07:14:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTsir-0008Vr-Nn for qemu-devel@nongnu.org; Thu, 01 Nov 2012 07:14:05 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA1BAYnM004166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Nov 2012 07:10:34 -0400 Received: from localhost (ovpn-112-26.ams2.redhat.com [10.36.112.26]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA1BAWhT003534; Thu, 1 Nov 2012 07:10:33 -0400 From: Stefan Hajnoczi To: Anthony Liguori Date: Thu, 1 Nov 2012 12:10:16 +0100 Message-Id: <1351768218-21466-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1351768218-21466-1-git-send-email-stefanha@redhat.com> References: <1351768218-21466-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Lei Li Subject: [Qemu-devel] [PATCH 2/4] net: use "socket" model name for UDP sockets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Lei Li Fix the problem that can not delete the udp socket. It's caused by passing "udp" model to net_socket_udp_init, but we do not have "udp" model in our model list. Pass the right model "socket" to init function. https://bugs.launchpad.net/qemu/+bug/1073585?comments=all Signed-off-by: Lei Li Signed-off-by: Stefan Hajnoczi --- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/socket.c b/net/socket.c index b75d567..c01323d 100644 --- a/net/socket.c +++ b/net/socket.c @@ -747,7 +747,7 @@ int net_init_socket(const NetClientOptions *opts, const char *name, error_report("localaddr= is mandatory with udp="); return -1; } - if (net_socket_udp_init(peer, "udp", name, sock->udp, sock->localaddr) == + if (net_socket_udp_init(peer, "socket", name, sock->udp, sock->localaddr) == -1) { return -1; }