Re: [PATCH] virsh: fix range of memtune command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/19/2010 10:46 AM, Eric Blake wrote:
* tools/virsh.c (cmdMemtune): Use long long for memory
sizes. Simplify allocation, and plug memory leak.
---
  tools/virsh.c |   21 ++++++++++-----------
  1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index cd4485f..4f41c6f 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2905,7 +2905,7 @@ static int
  cmdMemtune(vshControl * ctl, const vshCmd * cmd)
  {
      virDomainPtr dom;
-    int hard_limit, soft_limit, swap_hard_limit, min_guarantee;
+    long long hard_limit, soft_limit, swap_hard_limit, min_guarantee;
      int nparams = 0;
      unsigned int i = 0;
      virMemoryParameterPtr params = NULL, temp = NULL;
@@ -2918,24 +2918,24 @@ cmdMemtune(vshControl * ctl, const vshCmd * cmd)
          return FALSE;

      hard_limit =
-        vshCommandOptInt(cmd, VIR_DOMAIN_MEMORY_HARD_LIMIT,&hard_limit);
+        vshCommandOptLongLong(cmd, VIR_DOMAIN_MEMORY_HARD_LIMIT,&hard_limit);

Self-NAK - this fails to compile.  v2 coming up soon.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]