]> xenbits.xensource.com Git - libvirt.git/commitdiff
setmaxmem: remove the code to invoke virDomainSetMemory in cmdSetmaxmem
authorTaku Izumi <izumi.taku@jp.fujitsu.com>
Wed, 16 Mar 2011 08:58:57 +0000 (17:58 +0900)
committerEric Blake <eblake@redhat.com>
Thu, 7 Apr 2011 22:18:43 +0000 (16:18 -0600)
When the new maximum memory size becomes less than the current memory size,
I think it is not the libvirt client but the each driver that decides the behavior
(reject the operation or shrink the current memory size).

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
tools/virsh.c

index f2d2c9d1a5ad03d282d43eba903cd2e4025f72a9..a718abf09d2d739701e68ba1f5e8b138e0a7a6b6 100644 (file)
@@ -3046,15 +3046,7 @@ cmdSetmaxmem(vshControl *ctl, const vshCmd *cmd)
 
     if (virDomainSetMaxMemory(dom, kilobytes) != 0) {
         vshError(ctl, "%s", _("Unable to change MaxMemorySize"));
-        virDomainFree(dom);
-        return FALSE;
-    }
-
-    if (kilobytes < info.memory) {
-        if (virDomainSetMemory(dom, kilobytes) != 0) {
-            vshError(ctl, "%s", _("Unable to shrink current MemorySize"));
-            ret = FALSE;
-        }
+        ret = FALSE;
     }
 
     virDomainFree(dom);