[libvirt] [PATCH] nwfilter: fix tear down order and consolidate functions

Eric Blake eblake at redhat.com
Thu Apr 15 14:27:07 UTC 2010


On 04/14/2010 03:10 PM, Stefan Berger wrote:
> To avoid race-conditions, the tear down of a filter has to happen before
> the tap interface disappears and another tap interface with the same
> name can re-appear. This patch tries to fix this. In one place, where
> communication with the qemu monitor may fail, I am only tearing the
> filters down after knowing that the function did not fail.
> 
> I am also moving the tear down functions into an include file for other
> drivers to reuse.

ACK.

> +static inline void
> +virNWFilterTearVMNWFilters(virDomainObjPtr vm) {
> +    int i;
> +    for (i = 0; i < vm->def->nnets; i++)

Is it worth using C99 syntax, to condense two lines to one?

for (int i = 0; ...

But that's a general question, and should not hold up your patch.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list