From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S06jI-0002Bz-Fd for qemu-devel@nongnu.org; Wed, 22 Feb 2012 02:35:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S06jC-0001eK-S3 for qemu-devel@nongnu.org; Wed, 22 Feb 2012 02:35:12 -0500 Received: from plane.gmane.org ([80.91.229.3]:43221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S06jC-0001d9-Dg for qemu-devel@nongnu.org; Wed, 22 Feb 2012 02:35:06 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S06j9-0001bs-3d for qemu-devel@nongnu.org; Wed, 22 Feb 2012 08:35:03 +0100 Received: from 93-34-182-16.ip50.fastwebnet.it ([93.34.182.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Feb 2012 08:35:03 +0100 Received: from pbonzini by 93-34-182-16.ip50.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Feb 2012 08:35:03 +0100 From: Paolo Bonzini Date: Wed, 22 Feb 2012 08:31:06 +0100 Message-ID: References: <1328797918-1316-1-git-send-email-pbonzini@redhat.com> <1328797918-1316-6-git-send-email-pbonzini@redhat.com> <4F4402CA.2080206@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit In-Reply-To: <4F4402CA.2080206@suse.de> Subject: Re: [Qemu-devel] [PATCH 5/9] qom: add generic string parsing/printing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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