[libvirt PATCH 2/4] qemu: add support for setting host-phys-bits-limit

Peter Krempa pkrempa at redhat.com
Thu Mar 16 13:38:18 UTC 2023


On Wed, Mar 01, 2023 at 13:34:33 +0100, Ján Tomko wrote:
> Translate <maxphysaddr limit='39'/> to:
> host-phys-bits-limit=39
> 
> https://gitlab.com/libvirt/libvirt/-/issues/450
> https://bugzilla.redhat.com/show_bug.cgi?id=2171860
> 
> Signed-off-by: Ján Tomko <jtomko at redhat.com>
> ---
>  src/qemu/qemu_command.c                       |  3 ++
>  .../cpu-phys-bits-limit.x86_64-latest.args    | 34 +++++++++++++++++++
>  tests/qemuxml2argvtest.c                      |  1 +
>  3 files changed, 38 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-limit.x86_64-latest.args
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 4839d45a34..7eae858813 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -6450,6 +6450,9 @@ qemuBuildCpuCommandLine(virCommand *cmd,
>          switch (addr->mode) {
>          case VIR_CPU_MAX_PHYS_ADDR_MODE_PASSTHROUGH:
>              virBufferAddLit(&buf, ",host-phys-bits=on");
> +
> +            if (addr->limit > 0)
> +                virBufferAsprintf(&buf, ",host-phys-bits-limit=%d", addr->limit);
>              break;

Continuation from previous patch:
 - here you format it only when mode is _PASSTHROUGH
 - Value 0 is in a limbo state, parser accepts it but it doesn't get
   formatted on the commandline

Reviewed-by: Peter Krempa <pkrempa at redhat.com>


More information about the libvir-list mailing list