From patchwork Tue Mar 5 17:51:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 225116 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 A3CB32C0328 for ; Wed, 6 Mar 2013 04:52:38 +1100 (EST) Received: from localhost ([::1]:38577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCw2W-0001ea-UG for incoming@patchwork.ozlabs.org; Tue, 05 Mar 2013 12:52:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCw2C-0001bj-75 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 12:52:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCw2A-0007UC-Bz for qemu-devel@nongnu.org; Tue, 05 Mar 2013 12:52:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCw2A-0007U3-4w for qemu-devel@nongnu.org; Tue, 05 Mar 2013 12:52:14 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r25HqCtH013470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 5 Mar 2013 12:52:12 -0500 Received: from localhost (ovpn-113-84.phx2.redhat.com [10.3.113.84]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r25HqA6j030369; Tue, 5 Mar 2013 12:52:11 -0500 From: Amit Shah To: qemu list Date: Tue, 5 Mar 2013 23:21:16 +0530 Message-Id: <16c806d60aa5e9660ed7751bb4e37dcd278f97f0.1362505276.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Amit Shah , Anthony Liguori , Anthony Liguori Subject: [Qemu-devel] [PATCH 01/20] char-socket: fix error reporting 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: Anthony Liguori Right now the inet connect code tries all available addresses but until one doesn't fail. It passes local_err each time without clearing it from the previous failure. This can trigger an assert since the inet connect code tries to set an error on an object != NULL. Signed-off-by: Anthony Liguori Signed-off-by: Amit Shah --- util/qemu-sockets.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 1350ccc..3f12296 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -373,6 +373,10 @@ int inet_connect_opts(QemuOpts *opts, Error **errp, } for (e = res; e != NULL; e = e->ai_next) { + if (error_is_set(errp)) { + error_free(*errp); + *errp = NULL; + } if (connect_state != NULL) { connect_state->current_addr = e; }