[libvirt] [PATCH v5] memtune: Let virsh know the unlimited value for memory tunables
Eric Blake
eblake at redhat.com
Sat Jan 15 00:27:10 UTC 2011
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 at linux.vnet.ibm.com>
>
> 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 at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110114/bea44dd9/attachment-0001.sig>
More information about the libvir-list
mailing list