diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 438cbf0e421c1b6640bc04620f863d3df92cc029..5523fc7becf7b47958e787cc962f610fb219af5a 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -314,7 +314,11 @@
memtune
The optional memtune element provides details regarding the memory tunable parameters for the domain. If this is - omitted, it defaults to the OS provided defaults.
+ omitted, it defaults to the OS provided defaults. For QEMU/KVMi, the + parameters are applied to the QEMU process as a whole. Thus, when + counting them, one needs to add up guest RAM, guest video RAM, and + some memory overhead of QEMU itself. The last piece is hard to + determine so one needs guess and try.
hard_limit
The optional hard_limit element is the maximum memory the guest can use. The units for this value are kilobytes (i.e. blocks diff --git a/tools/virsh.c b/tools/virsh.c index 3c759b948d267a02715e00099b695312ae23f238..19e344951c4fca60205a14a39bacda17f23e2b9c 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3202,7 +3202,7 @@ static const vshCmdOptDef opts_memtune[] = { {"soft-limit", VSH_OT_INT, VSH_OFLAG_NONE, N_("Memory during contention in kilobytes")}, {"swap-hard-limit", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Max swap in kilobytes")}, + N_("Max memory plus swap in kilobytes")}, {"min-guarantee", VSH_OT_INT, VSH_OFLAG_NONE, N_("Min guaranteed memory in kilobytes")}, {NULL, 0, 0, NULL} diff --git a/tools/virsh.pod b/tools/virsh.pod index e882261258cc40b9719b9de9c7e7c31220b9d75d..f4bd294a7147f54c978929780d047f0dc94696ea 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -611,12 +611,42 @@ use the virsh B command instead to update its XML element. =item B I optional I<--hard-limit> B optional I<--soft-limit> B optional I<--swap-hard-limit> -B -I<--min-guarantee> B +B optional I<--min-guarantee> B Allows you to display or set the domain memory parameters. Without flags, the current settings are displayed; with a flag, the appropriate limit is adjusted if supported by the hypervisor. LXC and -QEMU/KVM supports I<--hard-limit>, I<--soft-limit>, and I<--swap-hard-limit>. +QEMU/KVM support I<--hard-limit>, I<--soft-limit>, and I<--swap-hard-limit>. + +For QEMU/KVM, the parameters are applied to the QEMU process as a whole. +Thus, when counting them, one needs to add up guest RAM, guest video RAM, and +some memory overhead of QEMU itself. The last piece is hard to determine so +one needs guess and try. + +=over 4 + +=item I<--hard-limit> + +The maximum memory the guest can use. The units for this value are kilobytes +(i.e. blocks of 1024 bytes). + +=item I<--soft-limit> + +The memory limit to enforce during memory contention. The units for this +value are kilobytes (i.e. blocks of 1024 bytes). + +=item I<--swap-hard-limit> + +The maximum memory plus swap the guest can use. The units for this value are +kilobytes (i.e. blocks of 1024 bytes). This has to be more than hard-limit +value provided. + +=item I<--min-guarantee> + +The guaranteed minimum memory allocation for the guest. The units for this +value are kilobytes (i.e. blocks of 1024 bytes). + +=back =item B I optional I<--weight> B