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
signature.asc
Description: OpenPGP digital signature