[CRIU] Re: [PATCH] parasite: Move selftests into separate helper
Pavel Emelyanov
xemul at parallels.com
Fri Oct 12 06:28:44 EDT 2012
On 10/12/2012 02:26 PM, Cyrill Gorcunov wrote:
> On Fri, Oct 12, 2012 at 02:18:22PM +0400, Pavel Emelyanov wrote:
>> On 10/11/2012 08:49 PM, Cyrill Gorcunov wrote:
>>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
>>
>> Look at parasite_args() fn I've introduced recently and make the
>> BUG_ON() there into BUILD_BUG_ON(). After this the BUILD_BUG_ON-s
>> in parasite can be dropped.
>>
>
> The main idea was to gather all prossible arguments size which
> are build-time checkable in one place, so I thought naming the
> function as __builtin_self_tests together with comment on top
> would provide us a better place for BUILD_BUG_ONs, because
>
> - when someone introduces some new structure he for sure will
> have to poke parasite_service routine and note the __builtin_self_tests
When someone introduces a new structure he will most likely forget to
update your routine (all the more so you put the comment about the
need to update not in the parasite.h, but in the routine itself). But
this someone _will_ _use_ it with parasite_args() and the check will
be done for sure.
> - thus he will add new structure there as well
>
> As to parasite_args -- this lives in a different file and I fear it's
> not that notable, I mean it'll be easy to miss the BUILD_BUG_ON there.
>
> Still if you think parasite_args() is better place, i'll update the patch.
> .
>
More information about the CRIU
mailing list