]> xenbits.xensource.com Git - libvirt.git/commitdiff
lxc: fix setmem effect on a running LXC machine
authorErik Skultety <eskultet@redhat.com>
Fri, 24 Oct 2014 09:17:20 +0000 (11:17 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 13 Nov 2014 14:11:59 +0000 (15:11 +0100)
When user calls setmem on a running LXC machine, we do update its cgroup
entry, 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

index 6a58d50ed17baa67d2fcc3f58c9839c500a74675..da94cd4e7985e8f51aec1f7ce8851872dc70f008 100644 (file)
@@ -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) {