As with patch 5, whether we need any changes here depends on whether the memory cgroup remains optional.
If the cgroup is optional, this patch should probably not be applied. If it is not, then other parts of the code need to be changed. On Mon, Aug 18, 2014 at 3:38 AM, Yuto KAWAMURA(kawamuray) < [email protected]> wrote: > Since we have supported the memory limit for the LXC container, we > s/have supported/support/ > should always have the memory subsystem mounted somewere, so failing > to get the memory limit from cgroup fs is not an acceptable situation. > ... the cgroup fs ... s/an acceptable situation/acceptable/ > > Signed-off-by: Yuto KAWAMURA(kawamuray) <[email protected]> > --- > lib/hypervisor/hv_lxc.py | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/lib/hypervisor/hv_lxc.py b/lib/hypervisor/hv_lxc.py > index 596def2..9678b2b 100644 > --- a/lib/hypervisor/hv_lxc.py > +++ b/lib/hypervisor/hv_lxc.py > @@ -355,12 +355,10 @@ class LXCHypervisor(hv_base.BaseHypervisor): > try: > mem_limit = cls._GetCgroupInstanceValue(instance_name, > "memory.limit_in_bytes") > - mem_limit = int(mem_limit) > - except EnvironmentError: > - # memory resource controller may be disabled, ignore > - mem_limit = 0 > - > - return mem_limit > + return int(mem_limit) > + except EnvironmentError, err: > + raise HypervisorError("Can't get instance memory limit of %s: %s" % > + (instance_name, err)) > > def ListInstances(self, hvparams=None): > """Get the list of running instances. > -- > 2.0.4 > > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnummer: DE813741370
