[Devel] [PATCH 3/3] hooks_ct: fix ub limits setting for upstream containers

Igor M Podlesny openvz at poige.ru
Fri May 10 18:07:48 PDT 2013


On 30 April 2013 11:46, Glauber Costa <glommer at openvz.org> wrote:
> Currently, vps_setup_res() have an explicit test for state != VPS_STARTING
> before applying beancounter limits. This means that we can set limits without
> further problems when the container is running, but will fail to do so when the
> container is starting. In fact, hooks_vz have an explicit call for it in its
> startup function.
>
> We should do the same, and call our version of setlimits ourselves when the
> container is coming up.
>
> Signed-off-by: Glauber Costa <glommer at openvz.org>
> ---
>  src/lib/hooks_ct.c | 147 +++++++++++++++++++++++++++--------------------------
>  1 file changed, 76 insertions(+), 71 deletions(-)
>
> diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c
> index 63af536..3cfb6e9 100644
> --- a/src/lib/hooks_ct.c
> +++ b/src/lib/hooks_ct.c
> @@ -153,6 +153,77 @@ static int _env_create(void *data)
>         return exec_container_init(arg, &create_param);
>  }
>
> +#define add_value(val, var, mult) do { if (val) { var = *val * mult; } } while (0)

   Aren't macroses supposed to be UPPER CASE named?

--



More information about the Devel mailing list