Re: [PATCH] lxc: fix setmem effect on a running LXC machine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: libvir-list-bounces@xxxxxxxxxx [mailto:libvir-list-bounces@xxxxxxxxxx]
> On Behalf Of Erik Skultety
> Sent: Friday, October 24, 2014 5:17 PM
> To: libvir-list@xxxxxxxxxx
> Cc: Erik Skultety
> Subject:  [PATCH] lxc: fix setmem effect on a running LXC machine
> 
> When user calls setmem on a running LXC machine, we do update its cgroup
> entry (which is in odds with the original bug report, possibly resolved
> by later versions), however we neither update domain's runtime XML nor
> we update our internal structures and this patch fixes it.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1131919
> ---
>  src/lxc/lxc_driver.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
> index b3e506f..03a00a9 100644
> --- a/src/lxc/lxc_driver.c
> +++ b/src/lxc/lxc_driver.c
> @@ -749,6 +749,10 @@ static int lxcDomainSetMemoryFlags(virDomainPtr dom,
> unsigned long newmem,
>                                 "%s", _("Failed to set memory for domain"));
>                  goto cleanup;
>              }
> +
> +            vm->def->mem.cur_balloon = newmem;
> +            if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
> +                goto cleanup;
>          }
> 
>          if (flags & VIR_DOMAIN_AFFECT_CONFIG) {

Looks good to me.

Reviewed-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>

Thanks,
- Chen

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]