On Wed, 2018-05-23 at 18:40 +0200, Peter Krempa wrote:
On Wed, May 23, 2018 at 18:18:02 +0200, Andrea Bolognani wrote:
> + /* QEMU expects the argument to be a number of left shifts:
> + * for example, if you wanted to limit the guest to 4 KiB pages,
> + * since 4096 == 1 << 12, you would need to add cap-hpt-mps=12
> + * to the command line.
So basically you need to pass the exponent of a power of 2 that yields
this number. The number of left shifts may be slightly confusing ...
I guess it depends on the reader; the two definitions are
equivalent anyway, so no harm in having both in the comment :)
In general, I'd say it's not the most user-friendly interface on
QEMU's side, but I believe it's dictated by hardware / emulator
details, given how it ends up being used: see
http://lists.nongnu.org/archive/html/qemu-devel/2018-04/msg02822.html
To be fair, it would perhaps make sense to perform the conversion
directly inside QEMU, in order to make it more convenient not only
for libvirt but for for people driving it directly as well.
CC'ing David so that he can weigh in on the idea.
--
Andrea Bolognani / Red Hat / Virtualization