Received: from eggs.gnu.org ([2001:4830:134:3::10]:52948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSPqG-0000ss-NK for qemu-devel@nongnu.org; Wed, 27 Jul 2016 10:29:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSPqE-0005SD-AH for qemu-devel@nongnu.org; Wed, 27 Jul 2016 10:29:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSPqE-0005S5-4q for qemu-devel@nongnu.org; Wed, 27 Jul 2016 10:29:46 -0400 From: Eduardo Habkost Date: Wed, 27 Jul 2016 11:29:21 -0300 Message-Id: <1469629761-23274-10-git-send-email-ehabkost@redhat.com> In-Reply-To: <1469629761-23274-1-git-send-email-ehabkost@redhat.com> References: <1469629761-23274-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PULL 9/9] vl: exit if a bad property value is passed to -global List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Richard Henderson , Marcel Apfelbaum , qemu-devel@nongnu.org, Greg Kurz From: Greg Kurz 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 Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vl.c b/vl.c index a455947..e7c2c62 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; } -- 2.5.5