From patchwork Wed Jul 13 18:05:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 648006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rqRdC33cQz9s5J for ; Thu, 14 Jul 2016 04:07:43 +1000 (AEST) Received: from localhost ([::1]:49337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNOZR-0007OL-2m for incoming@patchwork.ozlabs.org; Wed, 13 Jul 2016 14:07:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNOXz-0005Rp-A1 for qemu-devel@nongnu.org; Wed, 13 Jul 2016 14:06:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNOX5-0002Kn-Tt for qemu-devel@nongnu.org; Wed, 13 Jul 2016 14:06:10 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNOX5-0002KR-LY for qemu-devel@nongnu.org; Wed, 13 Jul 2016 14:05:15 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6DI4Nk6065544 for ; Wed, 13 Jul 2016 14:05:14 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 2452ypy1dx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 13 Jul 2016 14:05:14 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jul 2016 14:05:12 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 13 Jul 2016 14:05:10 -0400 X-IBM-Helo: d01dlp01.pok.ibm.com X-IBM-MailFrom: groug@kaod.org Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 211CA38C805E; Wed, 13 Jul 2016 14:05:07 -0400 (EDT) Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6DI57RS62783722; Wed, 13 Jul 2016 18:05:07 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E366FAE054; Wed, 13 Jul 2016 14:05:06 -0400 (EDT) Received: from bahia.lan (unknown [9.84.33.1]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id BBEA1AE05C; Wed, 13 Jul 2016 14:05:05 -0400 (EDT) From: Greg Kurz To: Paolo Bonzini Date: Wed, 13 Jul 2016 20:05:03 +0200 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071318-0056-0000-0000-000000C63832 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071318-0057-0000-0000-000004E04931 Message-Id: <146843310345.22044.7846135644864365198.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-13_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607130196 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH] vl: exit if a bad property value is passed to -global X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bharata B Rao , qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" When passing '-global driver=host-powerpc64-cpu,property=compat,value=foo' on the command line, without this patch, we get the following warning per device (which means many lines if the guests has many cpus): qemu-system-ppc64: Warning: can't apply global host-powerpc64-cpu.compat=foo: Invalid compatibility mode "foo" ... and QEMU continues execution, ignoring the property. With this patch, we get a single line: qemu-system-ppc64: can't apply global host-powerpc64-cpu.compat=foo: Invalid compatibility mode "foo" ... and QEMU exits. Signed-off-by: Greg Kurz Reviewed-by: David Gibson --- vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 356713ea075c..a7cc92781687 100644 --- a/vl.c +++ b/vl.c @@ -2922,6 +2922,7 @@ static int global_init_func(void *opaque, QemuOpts *opts, Error **errp) g->property = qemu_opt_get(opts, "property"); g->value = qemu_opt_get(opts, "value"); g->user_provided = true; + g->errp = errp; qdev_prop_register_global(g); return 0; } @@ -4451,7 +4452,7 @@ int main(int argc, char **argv, char **envp) machine_register_compat_props(current_machine); qemu_opts_foreach(qemu_find_opts("global"), - global_init_func, NULL, NULL); + global_init_func, NULL, &error_fatal); /* This checkpoint is required by replay to separate prior clock reading from the other reads, because timer polling functions query