Re: [libvirt] [PATCHv2 04/13] virbuf: add auto-indentation support

2011-10-21 Thread Hai Dong Li
On 10/21/2011 05:35 AM, Eric Blake wrote: On 10/19/2011 08:31 PM, Hai Dong Li wrote: This email is just for your attention. I'm relatively new to work in a community, so I didn't pay much attention to the readability of the comments last email. It seems comments lie in a large patch like

Re: [libvirt] [PATCHv2 07/13] snapshot: simplify indentation of sysinfo

2011-10-21 Thread Hai Dong Li
On 10/21/2011 06:41 AM, Eric Blake wrote: On 10/20/2011 04:20 AM, Daniel P. Berrange wrote: On Thu, Oct 20, 2011 at 12:14:57PM +0200, Peter Krempa wrote: On 09/29/2011 06:22 PM, Eric Blake wrote: The improvements to virBuffer, along with a paradigm shift to pass the original buffer through

Re: [libvirt] [PATCHv2 06/13] snapshot: test domainsnapshot indentation

2011-10-20 Thread Hai Dong Li
On 09/30/2011 12:22 AM, Eric Blake wrote: diff --git a/tests/domainsnapshotxml2xmlout/all_parameters.xml b/tests/domainsnapshotxml2xmlout/all_parameters.xml index ed4a600..eb2ee85 100644 --- a/tests/domainsnapshotxml2xmlout/all_parameters.xml +++

Re: [libvirt] [PATCHv2 04/13] virbuf: add auto-indentation support

2011-10-19 Thread Hai Dong Li
This email is just for your attention. I'm relatively new to work in a community, so I didn't pay much attention to the readability of the comments last email. It seems comments lie in a large patch like this is easily to be omitted. So I cut the codes, leave codes associated with the

Re: [libvirt] [PATCHv2 05/13] snapshot: indent domain xml when nesting

2011-10-19 Thread Hai Dong Li
On 10/20/2011 03:08 AM, Peter Krempa wrote: Dňa 29.9.2011 18:22, Eric Blake wrote / napísal(a): domainsnapshot is the first public instance ofdomain being used as a sub-element, although we have two other private uses (runtime state, and migration cookie). Although indentation has no effect

Re: [libvirt] [PATCHv2 04/13] virbuf: add auto-indentation support

2011-10-18 Thread Hai Dong Li
On 09/30/2011 12:22 AM, Eric Blake wrote: Rather than having to adjust all callers in a chain to deal with indentation, it is nicer to have virBuffer do auto-indentation. * src/util/buf.h (_virBuffer): Increase size. (virBufferAdjustIndent, virBufferGetIndent): New prototypes. *

Re: [libvirt] [PATCHv2 04/13] virbuf: add auto-indentation support

2011-10-18 Thread Hai Dong Li
On 09/30/2011 12:22 AM, Eric Blake wrote: Rather than having to adjust all callers in a chain to deal with indentation, it is nicer to have virBuffer do auto-indentation. * src/util/buf.h (_virBuffer): Increase size. (virBufferAdjustIndent, virBufferGetIndent): New prototypes. *

Re: [libvirt] [PATCHv2 01/13] virbuf: fix const-correctness

2011-10-17 Thread Hai Dong Li
On 09/30/2011 12:22 AM, Eric Blake wrote: Although the compiler wasn't complaining (since it was the pointer, rather than what was being pointed to, that was actually const), it looks quite suspicious to call a function with an argument labeled const when the nature of the pointer (virBufferPtr)

Re: [libvirt] [PATCHv2 01/13] virbuf: fix const-correctness

2011-10-17 Thread Hai Dong Li
On 10/17/2011 10:36 PM, Eric Blake wrote: On 10/17/2011 05:20 AM, Hai Dong Li wrote: On 09/30/2011 12:22 AM, Eric Blake wrote: Although the compiler wasn't complaining (since it was the pointer, rather than what was being pointed to, that was actually const), it looks quite suspicious to call

Re: [libvirt] [PATCHv2 02/13] virbuf: improve testsuite reporting

2011-10-17 Thread Hai Dong Li
On 09/30/2011 12:22 AM, Eric Blake wrote: I had some temporary test failures while working on virbuf improvements in later patches, with output that looked like: Expected [] Actual [] which is pretty hard to figure out. Adding an Offset designation made it much easier to find which particular

Re: [libvirt] [PATCHv2 03/13] virbuf: more detailed error reporting

2011-10-17 Thread Hai Dong Li
On 09/30/2011 12:22 AM, Eric Blake wrote: The next patch wants to add some sanity checking, which would be a different error than ENOMEM. Many existing callers blindly report OOM failure if virBuf reports an error, and this will be wrong in the (unlikely) case that they actually had a usage

Re: [libvirt] [PATCH 00/14] snapshot: improve dumpxml output

2011-09-26 Thread Hai Dong Li
On 09/23/2011 04:34 AM, Eric Blake wrote: This series fixes 'virsh snapshot-dumpxml' to use nicer formatting. Patch 1 adds some nice helper routines, patches 2-13 are mostly mechanical conversions to use the helpers and pass indentation levels through the entire call chain, and patch 14 adds a

Re: [libvirt] [PATCH 00/14] snapshot: improve dumpxml output

2011-09-26 Thread Hai Dong Li
On 09/26/2011 05:03 PM, Hai Dong Li wrote: On 09/23/2011 04:34 AM, Eric Blake wrote: This series fixes 'virsh snapshot-dumpxml' to use nicer formatting. Patch 1 adds some nice helper routines, patches 2-13 are mostly mechanical conversions to use the helpers and pass indentation levels through

Re: [libvirt] [PATCH 00/14] snapshot: improve dumpxml output

2011-09-26 Thread Hai Dong Li
On 09/27/2011 06:39 AM, Eric Blake wrote: On 09/26/2011 03:45 PM, Eric Blake wrote: It can be seen that the domain/domain indent correctly. I typed 'make check' in the tests directory. The domainsnapshotxml2xmltest part output: TEST: domainsnapshotxml2xmltest .. 6 OK PASS: