[libvirt] [PATCH 06/10] conf: virDomainDiskDefIotuneParse: simplfiy parsing

Cole Robinson crobinso at redhat.com
Tue Apr 12 14:29:34 UTC 2016


On 04/12/2016 09:55 AM, Peter Krempa wrote:
> Since the structure was pre-initialized to 0 we don't need to set every
> single member to 0 if it's not present in the XML. Additionally if we
> put the name of the field into the error message the code can be
> simplified using a macro to parse the members.
> ---
>  src/conf/domain_conf.c | 81 +++++++++-----------------------------------------
>  1 file changed, 14 insertions(+), 67 deletions(-)
> 

Technically virXPathULongLong can thrown an error with -1 if one of the passed
values is NULL, but old code wasn't handling that, and virxml.c should
probably either drop those conditionals or use a separate error code for it.

ACK

- Cole




More information about the libvir-list mailing list