[libvirt] [PATCH 07/10] conf: virDomainDiskDefIotuneParse: Report malformed number errors

Peter Krempa pkrempa at redhat.com
Wed Apr 13 06:24:45 UTC 2016


On Tue, Apr 12, 2016 at 10:31:29 -0400, Cole Robinson wrote:
> On 04/12/2016 09:55 AM, Peter Krempa wrote:
> > Rest of the fields of the iotune data structure did not check for
> > malformed integers. Use the previously defined macro to extract them
> > which will simplify the code and add error reporting.
> > ---
> >  src/conf/domain_conf.c | 50 ++++++++------------------------------------------
> >  1 file changed, 8 insertions(+), 42 deletions(-)
> > 
> 
> ACK... we need more of these cleanups, there's way too much boilerplate in the
> codebase (he says as he just tried to add an extra 100 with setlocale error
> checking :) )

Adding new code is inevitable. I find more troubling that we have
functions spanning thousands of lines and we are even adding code to
them from time to time. Spaghetti code must die.

I try to keep the functions so that they fit on one screen, but that
measure still isn't entirely universal since I use vertical screens :D.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160413/006eb1bc/attachment-0001.sig>


More information about the libvir-list mailing list