[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 2/2] vl: exit if a bad property value is passed t
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PATCH v3 2/2] vl: exit if a bad property value is passed to -global |
Date: |
Fri, 22 Jul 2016 01:02:30 +0200 |
User-agent: |
StGit/0.17.1-dirty |
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 <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
---
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;
}
[Qemu-devel] [PATCH v3 2/2] vl: exit if a bad property value is passed to -global,
Greg Kurz <=
Re: [Qemu-devel] [PATCH v3 0/2] improve error handling of global properties, Eduardo Habkost, 2016/07/26