[libvirt] [PATCH 1/2] util: Turn virFirewallAddRule() into a macro

Martin Kletzander mkletzan at redhat.com
Tue Jan 3 13:48:33 UTC 2017


On Tue, Jan 03, 2017 at 02:17:38PM +0100, Andrea Bolognani wrote:
>On Tue, 2017-01-03 at 13:46 +0100, Martin Kletzander wrote:
>> > To solve the issue, turn virFirewallAddRule() from a very thin
>> > wrapper around virFirewallAddRuleFullV() to a macro that expands
>> > to a call to virFirewallAddRuleFull() - itself a very thin wrapper
>> > around the aforementioned virFirewallAddRuleFullV() - with no loss
>> > of functionality or type safety.
>> > ---
>> > This only seems to be required on very specific combinations
>> > of Clang and host OS, eg. I need it on Clang 3.9 / Fedora
>> > rawhide but not on Clang 3.8 or 4.0 / Debian sid.
>> 
>> We sent various patches for this (me, Jan and maybe other people as
>> well).  I never realized it's not a problem with different versions of
>> clang.
>
>Oh, must have missed the previous attempts to fix this.
>
>> I would say it's not a problem for us to solve it in this case,
>> however, as I wrote in my solution, it works, but it's undefined from
>> the specification point of view.  Can it work just because
>> virFirewallAddRule() gets optimized into inline function?  it shouldn't
>> be, though...  I don't know.
>
>I lean towards merging this or a comparable solution. It's
>true that we aren't currently hitting this on our main
>targets, but relying on undefined behavior is definitely
>something we want to avoid, plus I don't see any real
>drawbacks in changing this to a macro.
>

Feel free to have a look at the other approaches (and whole threads) and see
what you like:

 - https://www.redhat.com/archives/libvir-list/2016-June/msg02173.html
 - https://www.redhat.com/archives/libvir-list/2016-December/msg00379.html

Yeah, it goes a long way back, and I know about even longer standing
clang problems that we're just not dealing with.

Martin

>-- 
>Andrea Bolognani / Red Hat / Virtualization
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- 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/20170103/6218a316/attachment-0001.sig>


More information about the libvir-list mailing list