From patchwork Fri Feb 22 19:51:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 222625 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 4048F2C02A6 for ; Sat, 23 Feb 2013 06:51:47 +1100 (EST) Received: from localhost ([::1]:43858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8yen-0006Hj-Fk for incoming@patchwork.ozlabs.org; Fri, 22 Feb 2013 14:51:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8yee-0006H5-Fa for qemu-devel@nongnu.org; Fri, 22 Feb 2013 14:51:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8yeY-00085z-Rz for qemu-devel@nongnu.org; Fri, 22 Feb 2013 14:51:36 -0500 Received: from david.siemens.de ([192.35.17.14]:33145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8yeY-00085j-IQ for qemu-devel@nongnu.org; Fri, 22 Feb 2013 14:51:30 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id r1MJpR3t006399; Fri, 22 Feb 2013 20:51:28 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id r1MJpR6M021499; Fri, 22 Feb 2013 20:51:27 +0100 Message-ID: <5127CC3F.5030703@siemens.com> Date: Fri, 22 Feb 2013 20:51:27 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Laszlo Ersek , Stefan Hajnoczi , Anthony Liguori References: <1361356113-11049-1-git-send-email-stefanha@redhat.com> <1361356113-11049-7-git-send-email-stefanha@redhat.com> <5127ABCE.1070602@siemens.com> <5127BE31.5080904@redhat.com> In-Reply-To: <5127BE31.5080904@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 192.35.17.14 Cc: Paolo Bonzini , "qemu-devel@nongnu.org" Subject: [Qemu-devel] [PATCH] slirp: Properly initialize pollfds_idx of new 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 Otherwise we may start processing sockets in slirp_pollfds_poll that were created past slirp_pollfds_fill. Signed-off-by: Jan Kiszka Reviewed-by: Laszlo Ersek Reviewed-by: Stefan Hajnoczi --- Not sure if this pattern also applies to other users besides slirp. Worth checking I suppose. slirp/socket.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/slirp/socket.c b/slirp/socket.c index a7ab933..bb639ae 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -51,6 +51,7 @@ socreate(Slirp *slirp) so->so_state = SS_NOFDREF; so->s = -1; so->slirp = slirp; + so->pollfds_idx = -1; } return(so); }