[libvirt] [PATCH] tests/networkxml2conf: Fix to work again on non-Linux

Martin Kletzander mkletzan at redhat.com
Fri Dec 23 10:29:23 UTC 2016


On Fri, Dec 23, 2016 at 11:12:37AM +0100, Andrea Bolognani wrote:
>On Fri, 2016-12-23 at 10:45 +0100, Martin Kletzander wrote:
>> >     if (virAsprintf(&inxml, "%s/networkxml2confdata/%s.xml",
>> >                     abs_srcdir, info->name) < 0 ||
>> > -        virAsprintf(&outxml, "%s/networkxml2confdata/%s.conf",
>> > -                    abs_srcdir, info->name) < 0) {
>> > +        virAsprintf(&outxml, "%s/networkxml2confdata/%s-%s.conf",
>> > +                    abs_srcdir, info->name, os) < 0) {
>> 
>> LOL, "outxml" is not XML at all.
>
>I hadn't noticed. Nice :D
>
>> But anyway, I'm sorry to say this, but honestly?  Gross.  I'd rather
>> change except-interface=lo to except-interface=LOOPBACK_NAME and then
>> strstr() and memmove() the outxml.  Just my $.02, though.
>
>I could see that becoming an issue when more test cases are
>added if enough attention is not paid during review, but I
>guess the same could happen with people only adding the Linux
>variant of the output file.
>
>That said, it would achieve my goal of unbreaking the test
>case on FreeBSD without adding hacks to the code being tested,
>so if you feel like taking a stab at implementing it[1] I'll
>be happy to review :)
>

OK, I'll exchange it for making libvirt compile with clang (3.9,
preferably) on Linux ;)

>
>[1] aka "putting your $.02 where your mouth is" :P
>-- 
>Andrea Bolognani / Red Hat / Virtualization
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161223/c1106d70/attachment-0001.sig>


More information about the libvir-list mailing list