unicorn/qemu/qom
Markus Armbruster 1b38f5208f
qom: Fix invalid error check in property_get_str()
When a function returns a null pointer on error and only on error, you
can do

if (!foo(foos, errp)) {
... handle error ...
}

instead of the more cumbersome

Error *err = NULL;

if (!foo(foos, &err)) {
error_propagate(errp, err);
... handle error ...
}

A StringProperty's getter, however, may return null on success! We
then fail to call visit_type_str().

Screwed up in 6a146eb, v1.1.

Fails tests/qom-test in my current, heavily hacked QAPI branch. No
reproducer for master known (but I didn't look hard).

Backports commit a479b21c111a87a50203a7413c4e5ec419fc88dd from qemu
2018-02-17 15:23:24 -05:00
..
container.c Automated leading tab to spaces conversion. 2017-01-21 12:28:22 +11:00
cpu.c cpu: Initialize breakpoint/watchpoint lists in cpu_common_initfn() 2018-02-17 15:23:18 -05:00
Makefile.objs import 2015-08-21 15:04:50 +08:00
object.c qom: Fix invalid error check in property_get_str() 2018-02-17 15:23:24 -05:00
qom-qobject.c handle some errors properly so avoid exit() during initialization. this fixes issue #237 2015-11-12 01:43:41 +08:00