qemu/qom
Markus Armbruster e1c8237df5 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).

Cc: Anthony Liguori <anthony@codemonkey.ws>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-09-19 08:10:12 +02:00
..
container.c Make all static TypeInfos const 2013-01-10 15:11:53 -06:00
cpu.c cpu: Add crash_occurred flag into CPUState 2015-09-16 17:33:32 +02:00
Makefile.objs qom: allow QOM to be linked into tools binaries 2015-09-15 14:35:39 +01:00
object_interfaces.c qom: Add can_be_deleted callback to UserCreatableClass 2015-04-01 10:06:38 +02:00
object.c qom: Fix invalid error check in property_get_str() 2015-09-19 08:10:12 +02:00
qom-qobject.c qom: move include files to include/qom/ 2012-12-19 08:31:32 +01:00