From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2COH-0006fg-7I for qemu-devel@nongnu.org; Tue, 09 Jun 2015 01:48:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2COF-0005NW-Q1 for qemu-devel@nongnu.org; Tue, 09 Jun 2015 01:48:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2COF-0005N3-LB for qemu-devel@nongnu.org; Tue, 09 Jun 2015 01:47:59 -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 (Postfix) with ESMTPS id 456D3A0CDC for ; Tue, 9 Jun 2015 05:47:59 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t595lvjc016680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 9 Jun 2015 01:47:58 -0400 From: Markus Armbruster Date: Tue, 9 Jun 2015 07:47:50 +0200 Message-Id: <1433828876-10892-4-git-send-email-armbru@redhat.com> In-Reply-To: <1433828876-10892-1-git-send-email-armbru@redhat.com> References: <1433828876-10892-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL v2 3/9] vl: Fail right after first bad -object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Failure to create an object with -object is a fatal error. However, we delay the actual exit until all -object are processed. On the one hand, this permits detection of genuine additional errors. On the other hand, it can muddy the waters with uninteresting additional errors, e.g. when a later -object tries to reference a prior one that failed. We generally stop right on the first bad option, so do that for -object as well. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 680f4d8..c9c3f33 100644 --- a/vl.c +++ b/vl.c @@ -4055,7 +4055,7 @@ int main(int argc, char **argv, char **envp) } if (qemu_opts_foreach(qemu_find_opts("object"), - object_create, NULL, 0) != 0) { + object_create, NULL, 1) != 0) { exit(1); } -- 1.9.3