[libvirt] [PATCH] nwfilter: cleanup return codes in nwfilter subsystem

Eric Blake eblake at redhat.com
Thu Nov 24 13:16:24 UTC 2011


On 11/23/2011 03:49 PM, Eric Blake wrote:
> On 11/23/2011 02:19 PM, Stefan Berger wrote:
>> This patch cleans up return codes in the nwfilter subsystem.
>>
>> Some functions in nwfilter_conf.c (validators and formatters) are
>> keeping their bool return for now and I am converting their return
>> code to true/false.
>>
>> All other functions now return -1 on failure and 0 on success.
>>

> I compile tested this, and assume you also ran it through libvirt-TCK.
> My compile run complained:
> 
> qemu/qemu_command.c: In function 'qemuNetworkIfaceConnect':
> qemu/qemu_command.c:278:65: error: suggest braces around empty body in
> an 'if' statement [-Werror=empty-body]
> 
> [more on this below]

The quickie fix:

diff --git i/src/qemu/qemu_command.c w/src/qemu/qemu_command.c
index 4310a62..0220ac3 100644
--- i/src/qemu/qemu_command.c
+++ w/src/qemu/qemu_command.c
@@ -275,7 +275,7 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,

     if (tapfd >= 0) {
         if ((net->filter) && (net->ifname)) {
-            if (virDomainConfNWFilterInstantiate(conn, net) < 0);
+            if (virDomainConfNWFilterInstantiate(conn, net) < 0)
                 VIR_FORCE_CLOSE(tapfd);
         }
     }

>> Index: libvirt-acl/src/nwfilter/nwfilter_driver.c
> 
> This is as far as I got today.

Alas, I don't have time to resume this today; it will probably be Monday
before I can audit the rest of the patch for sanity.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111124/9a7680b0/attachment-0001.sig>


More information about the libvir-list mailing list