Am 11.05.2012 16:45, schrieb Paolo Bonzini: > Il 11/05/2012 16:20, Andreas Färber ha scritto: >> char *string = NULL; >> >>>> >>>> mo = string_output_visitor_new(); >>>> - object_property_get(obj, string_output_get_visitor(mo), name, NULL); >>>> + object_property_get(obj, string_output_get_visitor(mo), name, errp); >> If we do error checking we should be consequent and do: >> >> if (!error_is_set(errp)) { >> >>>> string = string_output_get_string(mo); >> } >> >>>> string_output_visitor_cleanup(mo); > > Or just say that it is part of the string_output_visitor interface that > in case of an error the returned string is NULL.
I see it now: The StringOutputVisitor is allocated with g_malloc0(), so that it's initially NULL. get_string_output() would thus simply pass through NULL and doesn't need special error handling. Thanks, applied to qom-1.1 and qom-next: http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-1.1 http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-next Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg