Hello,
There are many configurable options when starting QEMU that are controlled by environment variables, and I'm trying to figure out how to pursuade LAVA v2 to set them.
As an example, configuring the host audio driver used by QEMU is set by running QEMU with: QEMU_AUDIO_DRV=<option> qemu-system-x86_64.
Unfortunately, device-types/qemu.jinja2 doesn't provide anyway to override the qemu-system binary used (it's conditional based on arch), but even a quick hack to allow it to be overriden[1], and adding the env as a prefix didn't because LAVA assumes the first item is an actual binary expected in $PATH. My attempt led to:
Invalid job definition Cannot find command 'QEMU_AUDIO_DRV=none qemu-system-x86_64' in $PATH
Seems like there should be a more general way to pass enviornment variables to QEMU that I must be missing. If there's not, would be the recommended way to add this feature?
Kevin
[1] diff --git a/lava_scheduler_app/tests/device-types/qemu.jinja2 b/lava_scheduler_app/tests/device-types/qemu.jinja2 index 786f53bdb30d..e7c265a3048b 100644 --- a/lava_scheduler_app/tests/device-types/qemu.jinja2 +++ b/lava_scheduler_app/tests/device-types/qemu.jinja2 @@ -41,7 +41,7 @@ actions: {% elif arch == 'arm' %} qemu-system-arm {% elif arch == 'amd64' or arch == 'x86_64' %} - qemu-system-x86_64 + {{ qemu_command|default('qemu-system-x86_64') }} {% elif arch == 'i386' %} qemu-system-i386 {% endif %}
With that change, I added
context: qemu_command: "QEMU_AUDIO_DRV=none qemu-system-x86_64"
to the job definition