[Top][All Lists]

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

Re: [Qemu-devel] [PATCH v1 5/6] qapi: generate a qapi_stringify_TYPENAME

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v1 5/6] qapi: generate a qapi_stringify_TYPENAME method for all types
Date: Tue, 7 Jun 2016 10:23:45 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06/07/2016 04:11 AM, Daniel P. Berrange wrote:
> There are sometimes cases where one might wish to have a
> pretty string representation of a QAPI type. For example,
> the 'qemu-img info' tool wants to print out ImageInfoSpecific
> type in a humand friendly format. Also when debugging problems
> in code it is often useful to insert code to print out a QAPI
> object.
> To address this, add a qapi_stringify_TYPENAME() method for
> all types which wraps around the TextOutputVisitor to turn
> objects into pretty strings.

It might be nicer to copy the approach I used for the clone visitor,
with a QAPI_CLONE() macro that forwards to a special-case helper
(including necessary type-punning), rather than making a much larger .h
with lots of declarations that aren't actually used.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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