[CRIU] [PATCH 3/3] plugins: Use new plugins engine
Pavel Emelyanov
xemul at parallels.com
Tue Mar 4 10:00:39 PST 2014
> +#define run_plugin_hooks(__hook, ...) \
> +({ \
> + cr_plugin_desc_t *d; \
> + plugin_desc_t *this; \
> + int __ret = -ENOTSUP; \
> + \
> + list_for_each_entry(this, &cr_plugins_list, list) { \
> + d = cr_plugin_desc_from(this); \
> + if (d->max_hooks >= (unsigned int)__hook || \
> + !d->hooks[__hook]) \
Can we avoid this if (!hook) continue; looking? Most of the plugins
are expected to provide only 2 callbacks out of all possible (7 now).
Thus this loop is even now 70% empty, but things will get worse.
> + continue; \
> + __ret = ((__hook ##_t *)d->hooks[__hook])(__VA_ARGS__); \
> + if (__ret == -ENOTSUP) \
> + continue; \
> + else if (__ret) \
> + break; \
> + } \
> + __ret; \
> +})
More information about the CRIU
mailing list