[PATCH v3 3/4] qemu: Generate command line for tb-cache feature
Peter Krempa
pkrempa at redhat.com
Mon Dec 13 15:32:56 UTC 2021
On Thu, Dec 02, 2021 at 09:53:35 +0100, Michal Privoznik wrote:
> Generating command line is pretty easy - just put tb-size=XXX
> onto -accel tcg part. Note, that QEMU expects the size in MiB.
>
> Resolves: https://gitlab.com/libvirt/libvirt/-/issues/229
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> Tested-by: Kashyap Chamarthy <kchamart at redhat.com>
> ---
> src/qemu/qemu_command.c | 5 +++
> ...efault-cpu-tcg-features.x86_64-latest.args | 36 +++++++++++++++++++
> tests/qemuxml2argvtest.c | 1 +
> 3 files changed, 42 insertions(+)
> create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-tcg-features.x86_64-latest.args
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index c47998aabd..4b2b558aba 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -7282,6 +7282,11 @@ qemuBuildAccelCommandLine(virCommand *cmd,
> switch ((virDomainVirtType)def->virtType) {
> case VIR_DOMAIN_VIRT_QEMU:
> virBufferAddLit(&buf, "tcg");
> +
> + if (def->features[VIR_DOMAIN_FEATURE_TCG] == VIR_TRISTATE_SWITCH_ON) {
&&
tb-size > 0) {
> + virBufferAsprintf(&buf, ",tb-size=%llu",
> + def->tcg_features->tb_cache >> 10);
> + }
> break;
>
> case VIR_DOMAIN_VIRT_KVM::
More information about the libvir-list
mailing list