On 02/21/2012 09:47 PM, Andreas Färber wrote:
>> > +void object_property_parse(Object *obj, const char *string,
>> > +                           const char *name, Error **errp)
>> > +{
>> > +    StringInputVisitor *mi;
> Curious: where does mi/mo come from?

Cut-and-paste from the version using QMP visitors.

>> > +    mi = string_input_visitor_new(string);
>> > +    object_property_set(obj, string_input_get_visitor(mi), name, errp);
>> > +
>> > +    string_input_visitor_cleanup(mi);
>> > +}
>> > +
>> > +char *object_property_print(Object *obj, const char *name,
>> > +                            Error **errp)
>> > +{
>> > +    StringOutputVisitor *mo;
>> > +    char *string;
>> > +
>> > +    mo = string_output_visitor_new();
>> > +    object_property_get(obj, string_output_get_visitor(mo), name, NULL);
>> > +    string = string_output_get_string(mo);
>> > +    string_output_visitor_cleanup(mo);
>> > +    return string;
>> > +}

Paolo


Reply via email to