summaryrefslogtreecommitdiffstats
path: root/hw/core
diff options
context:
space:
mode:
authorEduardo Habkost2014-07-03 21:45:34 +0200
committerMichael S. Tsirkin2014-07-06 08:13:54 +0200
commit319627006a8f4c43b3618932ccac615c4662dfdc (patch)
treef962bba62008d10c71535ec69ec3a7d74c880d05 /hw/core
parenthw/virtio: enable common virtio feature for mmio device (diff)
downloadqemu-319627006a8f4c43b3618932ccac615c4662dfdc.tar.gz
qemu-319627006a8f4c43b3618932ccac615c4662dfdc.tar.xz
qemu-319627006a8f4c43b3618932ccac615c4662dfdc.zip
qdev: Don't abort() in case globals can't be set
It would be much better if we didn't terminate QEMU inside device_post_init(), but at least exiting cleanly is better than aborting and dumping core. Before this patch: $ qemu-system-x86_64 -global cpu.xxx=y qemu-system-x86_64: Property '.xxx' not found Aborted (core dumped) After this patch: $ qemu-system-x86_64 -global cpu.xxx=y qemu-system-x86_64: Property '.xxx' not found Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-By: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 3bdda8ef66..da1ba48c99 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -957,7 +957,13 @@ static void device_initfn(Object *obj)
static void device_post_init(Object *obj)
{
- qdev_prop_set_globals(DEVICE(obj), &error_abort);
+ Error *err = NULL;
+ qdev_prop_set_globals(DEVICE(obj), &err);
+ if (err) {
+ qerror_report_err(err);
+ error_free(err);
+ exit(EXIT_FAILURE);
+ }
}
/* Unlink device from bus and free the structure. */