Add qemu commandline environment variable support. (#961)

Make it easier to tweak some qemu options by allowing passthru of
command line environment variables.

- Also cleans up weird variable indirection used for qemu commandline args
  variable through `qargs` in various constructors.
- Addresses some functionality discussed in #776.
This commit is contained in:
Julio Lajara
2020-05-10 09:37:31 -04:00
committed by GitHub
parent f5f9e34da0
commit f00bc0eaae
6 changed files with 62 additions and 10 deletions

View File

@@ -143,5 +143,9 @@
<qemu:commandline>
<qemu:arg value='-device'/>
<qemu:arg value='dummy-device'/>
<qemu:env name='QEMU_AUDIO_DRV' value='pa'/>
<qemu:env name='QEMU_AUDIO_TIMER_PERIOD' value='150'/>
<qemu:env name='QEMU_PA_SAMPLES' value='1024'/>
<qemu:env name='QEMU_PA_SERVER' value='/run/user/1000/pulse/native'/>
</qemu:commandline>
</domain>

View File

@@ -11,7 +11,6 @@ describe 'templates/domain' do
def finalize!
super
@qargs = @qemu_args
end
end
@@ -76,6 +75,12 @@ describe 'templates/domain' do
domain.qemuargs(value: '-device')
domain.qemuargs(value: 'dummy-device')
domain.qemuenv(QEMU_AUDIO_DRV: 'pa')
domain.qemuenv(QEMU_AUDIO_TIMER_PERIOD: '150')
domain.qemuenv(QEMU_PA_SAMPLES: '1024')
domain.qemuenv(QEMU_PA_SERVER: '/run/user/1000/pulse/native')
domain.shares = '1024'
domain.cpuset = '1-4,^3,6'
domain.nodeset = '1-4,^3,6'