qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 5/9] qom: add generic string parsing/printing
Date: Wed, 22 Feb 2012 08:31:06 +0100	[thread overview]
Message-ID: <ji25jr$3jc$1@dough.gmane.org> (raw)
In-Reply-To: <4F4402CA.2080206@suse.de>

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	other threads:[~2012-02-22  7:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 14:31 [Qemu-devel] [PATCH 0/9] qdev deconstruction, command-line episode Paolo Bonzini
2012-02-09 14:31 ` [Qemu-devel] [PATCH 1/9] qapi: allow sharing enum implementation across visitors Paolo Bonzini
2012-02-21 20:31   ` Andreas Färber
2012-02-22  7:30     ` Paolo Bonzini
2012-02-09 14:31 ` [Qemu-devel] [PATCH 2/9] qapi: drop qmp_input_end_optional Paolo Bonzini
2012-02-09 14:31 ` [Qemu-devel] [PATCH 3/9] qapi: add string-based visitors Paolo Bonzini
2012-02-09 14:31 ` [Qemu-devel] [PATCH 4/9] qapi: add tests for " Paolo Bonzini
2012-02-09 14:31 ` [Qemu-devel] [PATCH 5/9] qom: add generic string parsing/printing Paolo Bonzini
2012-02-21 20:47   ` Andreas Färber
2012-02-22  7:31     ` Paolo Bonzini [this message]
2012-02-09 14:31 ` [Qemu-devel] [PATCH 6/9] qdev: accept both strings and integers for PCI addresses Paolo Bonzini
2012-02-09 14:31 ` [Qemu-devel] [PATCH 7/9] qdev: accept hex properties only if prefixed by 0x Paolo Bonzini
2012-02-09 14:31 ` [Qemu-devel] [PATCH 8/9] qdev: use built-in QOM string parser Paolo Bonzini
2012-02-09 14:31 ` [Qemu-devel] [PATCH 9/9] qdev: drop unnecessary parse/print methods Paolo Bonzini
2012-02-21 17:13 ` [Qemu-devel] [PULL v2 0/9] qdev deconstruction, command-line episode Paolo Bonzini
2012-02-22 14:44   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ji25jr$3jc$1@dough.gmane.org' \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).