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

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

 



On 01/13/2011 02:18 AM, Nikunj A. Dadhania wrote:
> Here is one more spin and guess we would be finally there :)

Here's hoping.

> 
> From: Nikunj A. Dadhania <nikunj@xxxxxxxxxxxxxxxxxx>
> 
> Display or set unlimited values for memory paramters. Unlimited is

s/paramters/parameters/

> represented by INT64_MAX in memory cgroup.
> 
> v5: return back to max as (INT64_MAX >> 10) for backward portablity.

s/portablity/portability/

> +++ b/tools/virsh.c
> @@ -2987,9 +2987,14 @@ 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);
> +                {

Not sure what the extra braces are for...

> +                    if (params[i].value.ul == VIR_DOMAIN_MEMORY_PARAM_UNLIMITED)
> +                        vshPrint(ctl, "%-15s: unlimited\n", params[i].field);
> +                    else
> +                        vshPrint(ctl, "%-15s: %llu kB\n", params[i].field,
> +                                 params[i].value.ul);
>                      break;
> +                }

since you didn't declare anything.  So I nuked them.

>                  case VIR_DOMAIN_MEMORY_PARAM_DOUBLE:
>                      vshPrint(ctl, "%-15s: %f\n", params[i].field,
>                               params[i].value.d);
> @@ -3039,6 +3044,10 @@ cmdMemtune(vshControl * ctl, const vshCmd * cmd)
>                          sizeof(temp->field));
>                  min_guarantee = 0;
>              }
> +
> +            /* If the user has passed -1, we interpret it as unlimited */
> +            if(temp->value.ul == -1)

space after if (keywords are different than function calls on preferred
spacing).

ACK with those nits fixed, so I pushed it.  Thanks again for tackling this.

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