[libvirt] [PATCH] setmaxmem: remove the code to invoke virDomainSetMemory in cmdSetmaxmem

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 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) Index: libvirt/tools/virsh.c =================================================================== --- libvirt.orig/tools/virsh.c +++ libvirt/tools/virsh.c @@ -3030,15 +3030,7 @@ cmdSetmaxmem(vshControl *ctl, const vshC 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);

On Wed, Mar 16, 2011 at 05:58:57PM +0900, Taku Izumi wrote:
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 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
Index: libvirt/tools/virsh.c =================================================================== --- libvirt.orig/tools/virsh.c +++ libvirt/tools/virsh.c @@ -3030,15 +3030,7 @@ cmdSetmaxmem(vshControl *ctl, const vshC
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);
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 03/17/2011 04:56 AM, Daniel P. Berrange wrote:
On Wed, Mar 16, 2011 at 05:58:57PM +0900, Taku Izumi wrote:
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).
ACK
Pushed. Oh dear - we missed this one for 0.9.0, even though it was acked in plenty of time. I'm starting to agree with Laine's proposal that having a mailing-list based helper engine that parses out known pending patch series would be helpful to avoid losing these in the flurry of a busy inbox. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Taku Izumi