]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Fix logic wrt to --current flag in cmdSetmem
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 18 May 2021 12:24:01 +0000 (14:24 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 19 May 2021 13:31:17 +0000 (15:31 +0200)
In my commit of v7.1.0-rc1~376 I've simplified the logic of
handling @flags. My assumption back then was that calling
virDomainSetMemory() is equivalent to
virDomainSetMemoryFlags(flags = 0). But that is not the case,
because it is equivalent to virDomainSetMemoryFlags(flags =
VIR_DOMAIN_AFFECT_LIVE). Fix the condition that calls the old
API.

Fixes: b5e267e8c59a257652f88d034cb1e0ce1ed4b58a
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1961118
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tools/virsh-domain.c

index 0825f82522aae968b9cf7993d7fe71df8148af6f..9316aae3fd1cab1d2d1f9949be1e53d552cb6824 100644 (file)
@@ -9025,7 +9025,7 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd)
     }
     kibibytes = VIR_DIV_UP(bytes, 1024);
 
-    if (flags == 0) {
+    if (!current && !live && !config) {
         if (virDomainSetMemory(dom, kibibytes) != 0)
             ret = false;
     } else {