qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 08/21] qdev: use object_property_print in info q


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 08/21] qdev: use object_property_print in info qtree
Date: Sat, 12 May 2012 02:23:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]