mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
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 <[email protected]>
Reviewed-By: Igor Mammedov <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
This commit is contained in:
1 parent
b7c9285b8d
commit
319627006a
1 file changed
+7
-1
+7
-1
@@ -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. */
|
||||
|
||||
Reference in new issue
Block a user