Re: [PATCH] memtune: Let virsh know the unlimited value for memory tunables

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

 



On 01/07/2011 12:09 AM, Nikunj A. Dadhania wrote:
> From: Nikunj A. Dadhania <nikunj@xxxxxxxxxxxxxxxxxx>
> 
> Display unlimited when the memory cgroup settings says so. Unlimited is
> represented by INT64_MAX in memory cgroup.
> 
> Signed-off-by: Nikunj A. Dadhania <nikunj@xxxxxxxxxxxxxxxxxx>
> Reported-by: Justin Clift <jclift@xxxxxxxxxx>
> ---
>  tools/virsh.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 55e2a68..bee875c 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -2987,9 +2987,15 @@ cmdMemtune(vshControl * ctl, const vshCmd * cmd)
>                               params[i].value.l);
>                      break;
>                  case VIR_DOMAIN_MEMORY_PARAM_ULLONG:
> -                    vshPrint(ctl, "%-15s: %llu\n", params[i].field,
> -                             params[i].value.ul);
> +                {
> +                    unsigned long long max_kbytes = INT64_MAX >> 10;

Yuck - why do the clients have to know the magic value?  Why not patch
the source to actually return INT64_MAX rather than INT64_MAX>>10 when
returning unlimited?

Actually, due to the issue of cross-versioning between virsh and the
actual libvirt running, we may have to check for both values.  But even
having a constant (VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) rather than making
guests recompute things might be nice.

But overall, I like the idea of this patch.

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]