From patchwork Thu Jul 21 23:02:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 9242635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C67B260574 for ; Thu, 21 Jul 2016 23:03:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3A4027C2C for ; Thu, 21 Jul 2016 23:03:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5CFD27F90; Thu, 21 Jul 2016 23:03:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2017D27C2C for ; Thu, 21 Jul 2016 23:03:09 +0000 (UTC) Received: from localhost ([::1]:44126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQMzk-0000x6-CS for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Jul 2016 19:03:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQMzK-0000v4-Pf for qemu-devel@nongnu.org; Thu, 21 Jul 2016 19:02:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQMzE-0003In-R3 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 19:02:41 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34802 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQMzE-0003Ii-KI for qemu-devel@nongnu.org; Thu, 21 Jul 2016 19:02:36 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6LMx3Pq030999 for ; Thu, 21 Jul 2016 19:02:36 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0b-001b2d01.pphosted.com with ESMTP id 24ay1u9v7u-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 21 Jul 2016 19:02:36 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Jul 2016 19:02:35 -0400 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 21 Jul 2016 19:02:34 -0400 X-IBM-Helo: d01dlp03.pok.ibm.com X-IBM-MailFrom: groug@kaod.org Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 7DA42C90042; Thu, 21 Jul 2016 19:02:23 -0400 (EDT) Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6LN2XQY58589270; Thu, 21 Jul 2016 23:02:33 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B8282803F; Thu, 21 Jul 2016 19:02:33 -0400 (EDT) Received: from bahia.lan (unknown [9.164.152.235]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP id E8DF22803A; Thu, 21 Jul 2016 19:02:31 -0400 (EDT) From: Greg Kurz To: Paolo Bonzini Date: Fri, 22 Jul 2016 01:02:30 +0200 In-Reply-To: <146914207036.16527.6025809385836923910.stgit@bahia.lan> References: <146914207036.16527.6025809385836923910.stgit@bahia.lan> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16072123-0044-0000-0000-000000B7AA00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16072123-0045-0000-0000-000004CDD4F7 Message-Id: <146914209477.16527.11807030409767780575.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-21_11:, , 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-1607210247 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v3 2/2] 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: David Gibson , qemu-devel@nongnu.org, Eduardo Habkost , Bharata B Rao Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. The previous behavior is kept for hotplugged devices since we don't want QEMU to exit when doing device_add. Reviewed-by: David Gibson Signed-off-by: Greg Kurz --- v3: - set directly the global property errp to &error_fatal --- vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vl.c b/vl.c index a455947b4f32..e7c2c628de29 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 = &error_fatal; qdev_prop_register_global(g); return 0; }