[libvirt] [PATCH] libxl: Set current memory value after successful balloon

Jim Fehlig posted 1 patch 5 years, 3 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190110223938.3364-1-jfehlig@suse.com
src/libxl/libxl_driver.c | 1 +
1 file changed, 1 insertion(+)
[libvirt] [PATCH] libxl: Set current memory value after successful balloon
Posted by Jim Fehlig 5 years, 3 months ago
The libxl driver does not set the new memory value in the active domain def
after a successful balloon. This results in the old memory value in
<currentMemory>. E.g.

virsh dumpxml test | grep currentMemory
  <currentMemory unit='KiB'>20971520</currentMemory>
virsh setmem test 16777216 --live
virsh dumpxml test | grep currentMemory
  <currentMemory unit='KiB'>20971520</currentMemory>

Set the new memory value in active domain def after a successful call to
libxl_set_memory_target().

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---
 src/libxl/libxl_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index e30c9891d2..f11597b0d7 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1676,6 +1676,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
                                  " with libxenlight"), vm->def->id);
                 goto endjob;
             }
+            vm->def->mem.cur_balloon = newmem;
         }
 
         if (flags & VIR_DOMAIN_MEM_CONFIG) {
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] libxl: Set current memory value after successful balloon
Posted by Ján Tomko 5 years, 3 months ago
On Thu, Jan 10, 2019 at 03:39:38PM -0700, Jim Fehlig wrote:
>The libxl driver does not set the new memory value in the active domain def
>after a successful balloon. This results in the old memory value in
><currentMemory>. E.g.
>
>virsh dumpxml test | grep currentMemory
>  <currentMemory unit='KiB'>20971520</currentMemory>
>virsh setmem test 16777216 --live
>virsh dumpxml test | grep currentMemory
>  <currentMemory unit='KiB'>20971520</currentMemory>
>
>Set the new memory value in active domain def after a successful call to
>libxl_set_memory_target().
>
>Signed-off-by: Jim Fehlig <jfehlig@suse.com>
>---
> src/libxl/libxl_driver.c | 1 +
> 1 file changed, 1 insertion(+)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

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