Richard W.M. Jones
2016-Feb-25 12:31 UTC
Re: [Libguestfs] [PATCH 3/3] src: print contents of structs and struct lists on tracing
On Wed, Feb 24, 2016 at 01:52:04PM +0100, Pino Toscano wrote:> It eases the debugging, instead of getting just the name of the struct > returned.The series is fine, so ACK. Definitely improves the trace output :-) A few things that would be good though: - Export the functions through the public API. We already have functions to copy structs (eg. guestfs_copy_application, guestfs_copy_application_list). - Provide another function for printing lists of structs too, so you don't need the loop for RStructList. - With those two changes, you can get rid of the internal structs-print.h header. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Pino Toscano
2016-Feb-25 13:30 UTC
Re: [Libguestfs] [PATCH 3/3] src: print contents of structs and struct lists on tracing
On Thursday 25 February 2016 12:31:30 Richard W.M. Jones wrote:> On Wed, Feb 24, 2016 at 01:52:04PM +0100, Pino Toscano wrote: > > It eases the debugging, instead of getting just the name of the struct > > returned. > > The series is fine, so ACK. Definitely improves the trace output :-)Thanks -- I got tired of not seeing what was returned in case of structs.> A few things that would be good though: > > - Export the functions through the public API. We already have > functions to copy structs (eg. guestfs_copy_application, > guestfs_copy_application_list).Would be actually worth exporting them for general usage, though? I thought about this, and I did not find immediate use cases; although I can change idea if there are enough/good ones. After all, making the current functions public is trivial job once there's the need for them.> - Provide another function for printing lists of structs too, so you > don't need the loop for RStructList.That would follow suit with the above: currently the loops for RStructList is needed only in one (private) place. -- Pino Toscano
Richard W.M. Jones
2016-Feb-25 13:58 UTC
Re: [Libguestfs] [PATCH 3/3] src: print contents of structs and struct lists on tracing
On Thu, Feb 25, 2016 at 02:30:48PM +0100, Pino Toscano wrote:> On Thursday 25 February 2016 12:31:30 Richard W.M. Jones wrote: > > On Wed, Feb 24, 2016 at 01:52:04PM +0100, Pino Toscano wrote: > > > It eases the debugging, instead of getting just the name of the struct > > > returned. > > > > The series is fine, so ACK. Definitely improves the trace output :-) > > Thanks -- I got tired of not seeing what was returned in case of > structs. > > > A few things that would be good though: > > > > - Export the functions through the public API. We already have > > functions to copy structs (eg. guestfs_copy_application, > > guestfs_copy_application_list). > > Would be actually worth exporting them for general usage, though? > I thought about this, and I did not find immediate use cases; although > I can change idea if there are enough/good ones.They become part of the API and ABI so we need to be really sure that we want to support the functions forever. But assuming they're well designed and future-proof I don't see why not. Rich.> After all, making the current functions public is trivial job once > there's the need for them. > > > - Provide another function for printing lists of structs too, so you > > don't need the loop for RStructList. > > That would follow suit with the above: currently the loops for > RStructList is needed only in one (private) place. > > -- > Pino Toscano> _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Apparently Analagous Threads
- Re: [PATCH 3/3] src: print contents of structs and struct lists on tracing
- Re: [PATCH 3/3] src: print contents of structs and struct lists on tracing
- [PATCH 3/3] src: print contents of structs and struct lists on tracing
- [PATCH 1/3] src: generate code for printing contents of structs
- [PATCH 0/6] Update the way that API versions are generated for the man page.