Re: [libvirt] [PATCH 4/4] Replace daemon-conf test script with a proper test case

2012-04-10 Thread Daniel P. Berrange
On Fri, Apr 06, 2012 at 11:05:02AM -0600, Eric Blake wrote:
> On 04/04/2012 08:07 AM, Daniel P. Berrange wrote:
> > +
> > +//VIR_DEBUG("New config [%s]", newdata);
> 
> Did you mean to leave this commented?

Yes, it makes the debug output far too verbose.


Daniel
-- 
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- http://virt-manager.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 4/4] Replace daemon-conf test script with a proper test case

2012-04-06 Thread Eric Blake
On 04/04/2012 08:07 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" 
> 
> The daemon-conf test script continues to be very fragile to
> changes in libvirt. It currently fails 1 time in 3/4 due
> to race conditions in startup/shutdown of the test script.
> 
> Replace it with a proper test case tailored to the code
> being tested
> 
> * tests/Makefile.am: Remove daemon-conf, add libvirtdconftest
> * tests/daemon-conf: Delete obsolete test
> * tests/libvirtdconftest.c: Test config file handling
> ---
>  tests/Makefile.am|   16 +++-
>  tests/daemon-conf|  115 ---
>  tests/libvirtdconftest.c |  230 
> ++
>  3 files changed, 243 insertions(+), 118 deletions(-)
>  delete mode 100755 tests/daemon-conf
>  create mode 100644 tests/libvirtdconftest.c

Definitely worth doing!!!

Missing a change to the top-level .gitignore to manage the new test name.

> +
> +if (VIR_ALLOC_N(dataout, dataoutlen) < 0) {
> +virReportOOMError();
> +return NULL;
> +}
> +memcpy(dataout, datain, (eq - datain) + 1);
> +memcpy(dataout + (eq - datain) + 1,
> +   replace, strlen(replace));

I might have written this as

strcpy(dataout + (eq - datain) + 1, replace)

for one less pass over replace, but it's not worth the micro-optimization.

> +
> +//VIR_DEBUG("New config [%s]", newdata);

Did you mean to leave this commented?

ACK with the nits fixed.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list