N_("Memory during contention in kilobytes")},
{VIR_DOMAIN_SWAP_HARD_LIMIT, VSH_OT_STRING, VSH_OFLAG_NONE,
N_("Max swap in kilobytes")},
+ {VIR_DOMAIN_MEMORY_MIN_GUARANTEE, VSH_OT_STRING, VSH_OFLAG_NONE,
+ N_("Min guaranteed memory in kilobytes")},
{NULL, 0, 0, NULL}
};
cmdMemtune(vshControl * ctl, const vshCmd * cmd)
{
virDomainPtr dom;
- int hard_limit, soft_limit, swap_hard_limit;
+ int hard_limit, soft_limit, swap_hard_limit, min_guarantee;
int nparams = 0;
unsigned int i = 0;
virMemoryParameterPtr params = NULL, temp = NULL;
if (swap_hard_limit)
nparams++;
+ min_guarantee =
+ vshCommandOptInt(cmd, VIR_DOMAIN_MEMORY_MIN_GUARANTEE,
+ &min_guarantee);
+ if (min_guarantee)
+ nparams++;
+
if (nparams == 0) {
/* get the number of memory parameters */
if ((virDomainGetMemoryParameters(dom, NULL, &nparams, 0) != 0) &&
params[i].value.b);
break;
default:
- vshPrint(ctl, "unimplemented scheduler parameter type\n");
+ vshPrint(ctl, "unimplemented memory parameter type\n");
}
}
strncpy(temp->field, VIR_DOMAIN_SWAP_HARD_LIMIT,
sizeof(temp->field));
swap_hard_limit = 0;
+ } else if (min_guarantee) {
+ temp->value.ul = min_guarantee;
+ strncpy(temp->field, VIR_DOMAIN_MEMORY_MIN_GUARANTEE,
+ sizeof(temp->field));
+ min_guarantee = 0;
}
}
if (virDomainSetMemoryParameters(dom, params, nparams, 0) != 0)
Displays the domain memory parameters.
-=item B<memtune> I<domain-id> optional I<--hard-limit> B<kilobytes> optional I<--soft-limit> B<kilobytes> optional I<--swap-hard-limit> B<kilobytes>
+=item B<memtune> I<domain-id> optional I<--hard-limit> B<kilobytes> optional I<--soft-limit> B<kilobytes> optional I<--swap-hard-limit> B<kilobytes> -I<--min-guarantee> B<kilobytes>
Allows you to set the domain memory parameters. LXC and QEMU/KVM supports these parameters.