Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_command.c | 62 +++++++++++++++++++
src/qemu/qemu_validate.c | 40 ++++++++++++
tests/qemuxml2argvdata/audio-alsa-best.args | 39 ++++++++++++
.../audio-alsa-best.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-alsa-best.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-alsa-full.args | 29 +++++++++
tests/qemuxml2argvdata/audio-alsa-full.err | 1 +
.../audio-alsa-full.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-alsa-full.xml | 43 +++++++++++++
.../audio-coreaudio-best.args | 39 ++++++++++++
.../audio-coreaudio-best.x86_64-latest.args | 42 +++++++++++++
.../qemuxml2argvdata/audio-coreaudio-best.xml | 43 +++++++++++++
.../audio-coreaudio-full.args | 29 +++++++++
.../qemuxml2argvdata/audio-coreaudio-full.err | 1 +
.../audio-coreaudio-full.x86_64-latest.args | 42 +++++++++++++
.../qemuxml2argvdata/audio-coreaudio-full.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-file-best.args | 39 ++++++++++++
.../audio-file-best.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-file-best.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-file-full.args | 29 +++++++++
tests/qemuxml2argvdata/audio-file-full.err | 1 +
.../audio-file-full.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-file-full.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-jack-full.err | 1 +
.../audio-jack-full.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-jack-full.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-none-best.args | 39 ++++++++++++
.../audio-none-best.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-none-best.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-none-full.args | 29 +++++++++
tests/qemuxml2argvdata/audio-none-full.err | 1 +
.../audio-none-full.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-none-full.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-oss-best.args | 12 +++-
.../audio-oss-best.x86_64-latest.args | 5 +-
tests/qemuxml2argvdata/audio-oss-best.xml | 8 ++-
tests/qemuxml2argvdata/audio-oss-full.args | 31 ++++++++++
tests/qemuxml2argvdata/audio-oss-full.err | 1 +
.../audio-oss-full.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-oss-full.xml | 43 +++++++++++++
.../audio-pulseaudio-best.args | 39 ++++++++++++
.../audio-pulseaudio-best.x86_64-latest.args | 42 +++++++++++++
.../audio-pulseaudio-best.xml | 43 +++++++++++++
.../audio-pulseaudio-full.args | 29 +++++++++
.../audio-pulseaudio-full.err | 1 +
.../audio-pulseaudio-full.x86_64-latest.args | 42 +++++++++++++
.../audio-pulseaudio-full.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-sdl-best.args | 10 +++
.../audio-sdl-best.x86_64-latest.args | 5 +-
tests/qemuxml2argvdata/audio-sdl-best.xml | 9 ++-
tests/qemuxml2argvdata/audio-sdl-full.args | 30 +++++++++
tests/qemuxml2argvdata/audio-sdl-full.err | 1 +
.../audio-sdl-full.x86_64-latest.args | 43 +++++++++++++
tests/qemuxml2argvdata/audio-sdl-full.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-spice-best.args | 39 ++++++++++++
.../audio-spice-best.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-spice-best.xml | 43 +++++++++++++
tests/qemuxml2argvdata/audio-spice-full.args | 29 +++++++++
tests/qemuxml2argvdata/audio-spice-full.err | 1 +
.../audio-spice-full.x86_64-latest.args | 42 +++++++++++++
tests/qemuxml2argvdata/audio-spice-full.xml | 43 +++++++++++++
tests/qemuxml2argvtest.c | 33 ++++++++++
tests/qemuxml2xmloutdata/audio-alsa-best.xml | 1 +
tests/qemuxml2xmloutdata/audio-alsa-full.xml | 1 +
.../audio-coreaudio-best.xml | 1 +
.../audio-coreaudio-full.xml | 1 +
tests/qemuxml2xmloutdata/audio-file-best.xml | 1 +
tests/qemuxml2xmloutdata/audio-file-full.xml | 1 +
tests/qemuxml2xmloutdata/audio-jack-full.xml | 1 +
tests/qemuxml2xmloutdata/audio-none-best.xml | 1 +
tests/qemuxml2xmloutdata/audio-none-full.xml | 1 +
tests/qemuxml2xmloutdata/audio-oss-full.xml | 1 +
.../audio-pulseaudio-best.xml | 1 +
.../audio-pulseaudio-full.xml | 1 +
tests/qemuxml2xmloutdata/audio-sdl-full.xml | 1 +
tests/qemuxml2xmloutdata/audio-spice-best.xml | 1 +
tests/qemuxml2xmloutdata/audio-spice-full.xml | 1 +
tests/qemuxml2xmltest.c | 17 +++++
78 files changed, 1963 insertions(+), 7 deletions(-)
create mode 100644 tests/qemuxml2argvdata/audio-alsa-best.args
create mode 100644 tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-alsa-best.xml
create mode 100644 tests/qemuxml2argvdata/audio-alsa-full.args
create mode 100644 tests/qemuxml2argvdata/audio-alsa-full.err
create mode 100644 tests/qemuxml2argvdata/audio-alsa-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-alsa-full.xml
create mode 100644 tests/qemuxml2argvdata/audio-coreaudio-best.args
create mode 100644 tests/qemuxml2argvdata/audio-coreaudio-best.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-coreaudio-best.xml
create mode 100644 tests/qemuxml2argvdata/audio-coreaudio-full.args
create mode 100644 tests/qemuxml2argvdata/audio-coreaudio-full.err
create mode 100644 tests/qemuxml2argvdata/audio-coreaudio-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-coreaudio-full.xml
create mode 100644 tests/qemuxml2argvdata/audio-file-best.args
create mode 100644 tests/qemuxml2argvdata/audio-file-best.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-file-best.xml
create mode 100644 tests/qemuxml2argvdata/audio-file-full.args
create mode 100644 tests/qemuxml2argvdata/audio-file-full.err
create mode 100644 tests/qemuxml2argvdata/audio-file-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-file-full.xml
create mode 100644 tests/qemuxml2argvdata/audio-jack-full.err
create mode 100644 tests/qemuxml2argvdata/audio-jack-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-jack-full.xml
create mode 100644 tests/qemuxml2argvdata/audio-none-best.args
create mode 100644 tests/qemuxml2argvdata/audio-none-best.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-none-best.xml
create mode 100644 tests/qemuxml2argvdata/audio-none-full.args
create mode 100644 tests/qemuxml2argvdata/audio-none-full.err
create mode 100644 tests/qemuxml2argvdata/audio-none-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-none-full.xml
create mode 100644 tests/qemuxml2argvdata/audio-oss-full.args
create mode 100644 tests/qemuxml2argvdata/audio-oss-full.err
create mode 100644 tests/qemuxml2argvdata/audio-oss-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-oss-full.xml
create mode 100644 tests/qemuxml2argvdata/audio-pulseaudio-best.args
create mode 100644 tests/qemuxml2argvdata/audio-pulseaudio-best.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-pulseaudio-best.xml
create mode 100644 tests/qemuxml2argvdata/audio-pulseaudio-full.args
create mode 100644 tests/qemuxml2argvdata/audio-pulseaudio-full.err
create mode 100644 tests/qemuxml2argvdata/audio-pulseaudio-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-pulseaudio-full.xml
create mode 100644 tests/qemuxml2argvdata/audio-sdl-full.args
create mode 100644 tests/qemuxml2argvdata/audio-sdl-full.err
create mode 100644 tests/qemuxml2argvdata/audio-sdl-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-sdl-full.xml
create mode 100644 tests/qemuxml2argvdata/audio-spice-best.args
create mode 100644 tests/qemuxml2argvdata/audio-spice-best.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-spice-best.xml
create mode 100644 tests/qemuxml2argvdata/audio-spice-full.args
create mode 100644 tests/qemuxml2argvdata/audio-spice-full.err
create mode 100644 tests/qemuxml2argvdata/audio-spice-full.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/audio-spice-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-alsa-best.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-alsa-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-coreaudio-best.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-coreaudio-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-file-best.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-file-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-jack-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-none-best.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-none-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-oss-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-pulseaudio-best.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-pulseaudio-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-sdl-full.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-spice-best.xml
create mode 120000 tests/qemuxml2xmloutdata/audio-spice-full.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 8a013c4ff4..6e2294ba9a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7587,6 +7587,34 @@ qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd,
return 0;
}
+static void
+qemuBuildAudioCommonArg(virBufferPtr buf,
+ const char *prefix,
+ virDomainAudioIOCommon *def)
+{
+ if (def->mixingEngine)
+ virBufferAsprintf(buf, ",%s.mixing-engine=%s", prefix,
+ virTristateSwitchTypeToString(def->mixingEngine));
+ if (def->fixedSettings)
+ virBufferAsprintf(buf, ",%s.fixed-settings=%s", prefix,
+ virTristateSwitchTypeToString(def->fixedSettings));
+
+ if (def->voices)
+ virBufferAsprintf(buf, ",%s.voices=%u", prefix, def->voices);
+ if (def->bufferLength)
+ virBufferAsprintf(buf, ",%s.buffer-length=%u", prefix,
def->bufferLength);
+
+ if (def->fixedSettings) {
+ if (def->frequency)
+ virBufferAsprintf(buf, ",%s.frequency=%u", prefix,
def->frequency);
+ if (def->channels)
+ virBufferAsprintf(buf, ",%s.channels=%u", prefix,
def->channels);
+ if (def->format)
+ virBufferAsprintf(buf, ",%s.format=%s", prefix,
+ virDomainAudioFormatTypeToString(def->format));
+ }
+}
+
static void
qemuBuildAudioOSSArg(virBufferPtr buf,
const char *prefix,
@@ -7608,6 +7636,9 @@ qemuBuildAudioCommandLineArg(virCommandPtr cmd,
def->id,
qemuAudioDriverTypeToString(def->type));
+ qemuBuildAudioCommonArg(&buf, "in", &def->input);
+ qemuBuildAudioCommonArg(&buf, "out", &def->output);
+
switch ((virDomainAudioType)def->type) {
case VIR_DOMAIN_AUDIO_TYPE_NONE:
break;
@@ -7672,6 +7703,34 @@ qemuBuildAudioCommandLineArgs(virCommandPtr cmd,
return 0;
}
+static void
+qemuBuildAudioCommonEnv(virCommandPtr cmd,
+ const char *prefix,
+ virDomainAudioIOCommon *def)
+{
+ if (def->fixedSettings)
+ virCommandAddEnvFormat(cmd, "%sFIXED_SETTINGS=%s",
+ prefix,
+ virTristateSwitchTypeToString(def->fixedSettings));
+
+ if (def->voices)
+ virCommandAddEnvFormat(cmd, "%sVOICES=%u",
+ prefix, def->voices);
+
+ if (def->fixedSettings) {
+ if (def->frequency)
+ virCommandAddEnvFormat(cmd, "%sFIXED_FREQ=%u",
+ prefix, def->frequency);
+ if (def->channels)
+ virCommandAddEnvFormat(cmd, "%sFIXED_CHANNELS=%u",
+ prefix, def->channels);
+ if (def->format)
+ virCommandAddEnvFormat(cmd, "%sFIXED_FMT=%s",
+ prefix,
+ virDomainAudioFormatTypeToString(def->format));
+ }
+}
+
static void
qemuBuildAudioOSSEnv(virCommandPtr cmd,
const char *prefix,
@@ -7694,6 +7753,9 @@ qemuBuildAudioCommandLineEnv(virCommandPtr cmd,
virCommandAddEnvPair(cmd, "QEMU_AUDIO_DRV",
qemuAudioDriverTypeToString(audio->type));
+ qemuBuildAudioCommonEnv(cmd, "QEMU_AUDIO_ADC_", &audio->input);
+ qemuBuildAudioCommonEnv(cmd, "QEMU_AUDIO_DAC_", &audio->output);
+
switch ((virDomainAudioType)audio->type) {
case VIR_DOMAIN_AUDIO_TYPE_NONE:
break;
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index e88f393fba..5aaadcb82d 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -4156,6 +4156,25 @@ static int
qemuValidateDomainDeviceDefAudio(virDomainAudioDefPtr audio,
virQEMUCapsPtr qemuCaps G_GNUC_UNUSED)
{
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) {
+ if (audio->input.mixingEngine == VIR_TRISTATE_BOOL_NO ||
+ audio->output.mixingEngine == VIR_TRISTATE_BOOL_NO) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("disabling audio mixing engine is not supported with
this QEMU"));
+ return -1;
+ }
+
+ if ((audio->input.bufferLength ||
+ audio->output.bufferLength) &&
+ (audio->type != VIR_DOMAIN_AUDIO_TYPE_PULSEAUDIO &&
+ audio->type != VIR_DOMAIN_AUDIO_TYPE_COREAUDIO &&
+ audio->type != VIR_DOMAIN_AUDIO_TYPE_SDL)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("setting audio buffer length is not supported with this
QEMU"));
+ return -1;
+ }
+ }
+
switch ((virDomainAudioType)audio->type) {
case VIR_DOMAIN_AUDIO_TYPE_NONE:
break;
@@ -4164,6 +4183,13 @@ qemuValidateDomainDeviceDefAudio(virDomainAudioDefPtr audio,
break;
case VIR_DOMAIN_AUDIO_TYPE_COREAUDIO:
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) {
+ if (audio->input.bufferLength) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("setting audio buffer length is not supported with
this QEMU"));
+ return -1;
+ }
+ }
break;
case VIR_DOMAIN_AUDIO_TYPE_JACK:
@@ -4178,9 +4204,23 @@ qemuValidateDomainDeviceDefAudio(virDomainAudioDefPtr audio,
break;
case VIR_DOMAIN_AUDIO_TYPE_PULSEAUDIO:
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) {
+ if (audio->input.bufferLength != audio->output.bufferLength) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("setting audio buffer length is not supported with
this QEMU"));
+ return -1;
+ }
+ }
break;
case VIR_DOMAIN_AUDIO_TYPE_SDL:
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) {
+ if (audio->input.bufferLength) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("setting audio buffer length is not supported with
this QEMU"));
+ return -1;
+ }
+ }
break;
case VIR_DOMAIN_AUDIO_TYPE_SPICE:
diff --git a/tests/qemuxml2argvdata/audio-alsa-best.args
b/tests/qemuxml2argvdata/audio-alsa-best.args
new file mode 100644
index 0000000000..4461fc670c
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-alsa-best.args
@@ -0,0 +1,39 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=alsa \
+QEMU_AUDIO_ADC_FIXED_SETTINGS=on \
+QEMU_AUDIO_ADC_VOICES=1 \
+QEMU_AUDIO_ADC_FIXED_FREQ=44100 \
+QEMU_AUDIO_ADC_FIXED_CHANNELS=2 \
+QEMU_AUDIO_ADC_FIXED_FMT=s16 \
+QEMU_AUDIO_DAC_FIXED_SETTINGS=on \
+QEMU_AUDIO_DAC_VOICES=2 \
+QEMU_AUDIO_DAC_FIXED_FREQ=22050 \
+QEMU_AUDIO_DAC_FIXED_CHANNELS=4 \
+QEMU_AUDIO_DAC_FIXED_FMT=f32 \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args
new file mode 100644
index 0000000000..5f84dcca72
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=alsa,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,\
+out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,\
+out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-alsa-best.xml
b/tests/qemuxml2argvdata/audio-alsa-best.xml
new file mode 100644
index 0000000000..cefcc47027
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-alsa-best.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='alsa'>
+ <input mixingEngine='yes' fixedSettings='yes'
voices='1'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-alsa-full.args
b/tests/qemuxml2argvdata/audio-alsa-full.args
new file mode 100644
index 0000000000..01fe6e2beb
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-alsa-full.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=alsa \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-alsa-full.err
b/tests/qemuxml2argvdata/audio-alsa-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-alsa-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-alsa-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-alsa-full.x86_64-latest.args
new file mode 100644
index 0000000000..6ade7ef069
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-alsa-full.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=alsa,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-alsa-full.xml
b/tests/qemuxml2argvdata/audio-alsa-full.xml
new file mode 100644
index 0000000000..2cd488a3a5
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-alsa-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='alsa'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-coreaudio-best.args
b/tests/qemuxml2argvdata/audio-coreaudio-best.args
new file mode 100644
index 0000000000..f8250df5cb
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-coreaudio-best.args
@@ -0,0 +1,39 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=coreaudio \
+QEMU_AUDIO_ADC_FIXED_SETTINGS=on \
+QEMU_AUDIO_ADC_VOICES=1 \
+QEMU_AUDIO_ADC_FIXED_FREQ=44100 \
+QEMU_AUDIO_ADC_FIXED_CHANNELS=2 \
+QEMU_AUDIO_ADC_FIXED_FMT=s16 \
+QEMU_AUDIO_DAC_FIXED_SETTINGS=on \
+QEMU_AUDIO_DAC_VOICES=2 \
+QEMU_AUDIO_DAC_FIXED_FREQ=22050 \
+QEMU_AUDIO_DAC_FIXED_CHANNELS=4 \
+QEMU_AUDIO_DAC_FIXED_FMT=f32 \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-coreaudio-best.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-coreaudio-best.x86_64-latest.args
new file mode 100644
index 0000000000..93166f27de
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-coreaudio-best.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=coreaudio,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,\
+out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,\
+out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-coreaudio-best.xml
b/tests/qemuxml2argvdata/audio-coreaudio-best.xml
new file mode 100644
index 0000000000..8a79404fde
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-coreaudio-best.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='coreaudio'>
+ <input mixingEngine='yes' fixedSettings='yes'
voices='1'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-coreaudio-full.args
b/tests/qemuxml2argvdata/audio-coreaudio-full.args
new file mode 100644
index 0000000000..c4d502b889
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-coreaudio-full.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=coreaudio \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-coreaudio-full.err
b/tests/qemuxml2argvdata/audio-coreaudio-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-coreaudio-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-coreaudio-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-coreaudio-full.x86_64-latest.args
new file mode 100644
index 0000000000..bc6c9e9241
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-coreaudio-full.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=coreaudio,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-coreaudio-full.xml
b/tests/qemuxml2argvdata/audio-coreaudio-full.xml
new file mode 100644
index 0000000000..671497986e
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-coreaudio-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='coreaudio'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-file-best.args
b/tests/qemuxml2argvdata/audio-file-best.args
new file mode 100644
index 0000000000..bd73a5b26f
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-file-best.args
@@ -0,0 +1,39 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=wav \
+QEMU_AUDIO_ADC_FIXED_SETTINGS=on \
+QEMU_AUDIO_ADC_VOICES=1 \
+QEMU_AUDIO_ADC_FIXED_FREQ=44100 \
+QEMU_AUDIO_ADC_FIXED_CHANNELS=2 \
+QEMU_AUDIO_ADC_FIXED_FMT=s16 \
+QEMU_AUDIO_DAC_FIXED_SETTINGS=on \
+QEMU_AUDIO_DAC_VOICES=2 \
+QEMU_AUDIO_DAC_FIXED_FREQ=22050 \
+QEMU_AUDIO_DAC_FIXED_CHANNELS=4 \
+QEMU_AUDIO_DAC_FIXED_FMT=f32 \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-file-best.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-file-best.x86_64-latest.args
new file mode 100644
index 0000000000..546e4debe8
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-file-best.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=wav,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,\
+out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,\
+out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-file-best.xml
b/tests/qemuxml2argvdata/audio-file-best.xml
new file mode 100644
index 0000000000..0617dbbc0b
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-file-best.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='file'>
+ <input mixingEngine='yes' fixedSettings='yes'
voices='1'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-file-full.args
b/tests/qemuxml2argvdata/audio-file-full.args
new file mode 100644
index 0000000000..fd504f50e7
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-file-full.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=wav \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-file-full.err
b/tests/qemuxml2argvdata/audio-file-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-file-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-file-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-file-full.x86_64-latest.args
new file mode 100644
index 0000000000..1f1f05b39c
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-file-full.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=wav,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-file-full.xml
b/tests/qemuxml2argvdata/audio-file-full.xml
new file mode 100644
index 0000000000..c695a1715e
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-file-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='file'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-jack-full.err
b/tests/qemuxml2argvdata/audio-jack-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-jack-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-jack-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-jack-full.x86_64-latest.args
new file mode 100644
index 0000000000..96856cd3d5
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-jack-full.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=jack,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-jack-full.xml
b/tests/qemuxml2argvdata/audio-jack-full.xml
new file mode 100644
index 0000000000..129bf509a0
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-jack-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='jack'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-none-best.args
b/tests/qemuxml2argvdata/audio-none-best.args
new file mode 100644
index 0000000000..6116734e4a
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-none-best.args
@@ -0,0 +1,39 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=none \
+QEMU_AUDIO_ADC_FIXED_SETTINGS=on \
+QEMU_AUDIO_ADC_VOICES=1 \
+QEMU_AUDIO_ADC_FIXED_FREQ=44100 \
+QEMU_AUDIO_ADC_FIXED_CHANNELS=2 \
+QEMU_AUDIO_ADC_FIXED_FMT=s16 \
+QEMU_AUDIO_DAC_FIXED_SETTINGS=on \
+QEMU_AUDIO_DAC_VOICES=2 \
+QEMU_AUDIO_DAC_FIXED_FREQ=22050 \
+QEMU_AUDIO_DAC_FIXED_CHANNELS=4 \
+QEMU_AUDIO_DAC_FIXED_FMT=f32 \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-none-best.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-none-best.x86_64-latest.args
new file mode 100644
index 0000000000..005f26dded
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-none-best.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=none,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,\
+out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,\
+out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-none-best.xml
b/tests/qemuxml2argvdata/audio-none-best.xml
new file mode 100644
index 0000000000..df79f705ac
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-none-best.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'>
+ <input mixingEngine='yes' fixedSettings='yes'
voices='1'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-none-full.args
b/tests/qemuxml2argvdata/audio-none-full.args
new file mode 100644
index 0000000000..00c6e37ccc
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-none-full.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-none-full.err
b/tests/qemuxml2argvdata/audio-none-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-none-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-none-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-none-full.x86_64-latest.args
new file mode 100644
index 0000000000..d303a161f8
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-none-full.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=none,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-none-full.xml
b/tests/qemuxml2argvdata/audio-none-full.xml
new file mode 100644
index 0000000000..f795a24be1
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-none-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-oss-best.args
b/tests/qemuxml2argvdata/audio-oss-best.args
index e6a7bb4af8..054222992f 100644
--- a/tests/qemuxml2argvdata/audio-oss-best.args
+++ b/tests/qemuxml2argvdata/audio-oss-best.args
@@ -7,8 +7,16 @@ XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
QEMU_AUDIO_DRV=oss \
-QEMU_OSS_ADC_DEV=/dev/dsp0 \
-QEMU_OSS_DAC_DEV=/dev/dsp1 \
+QEMU_AUDIO_ADC_FIXED_SETTINGS=on \
+QEMU_AUDIO_ADC_VOICES=1 \
+QEMU_AUDIO_ADC_FIXED_FREQ=44100 \
+QEMU_AUDIO_ADC_FIXED_CHANNELS=2 \
+QEMU_AUDIO_ADC_FIXED_FMT=s16 \
+QEMU_AUDIO_DAC_FIXED_SETTINGS=on \
+QEMU_AUDIO_DAC_VOICES=2 \
+QEMU_AUDIO_DAC_FIXED_FREQ=22050 \
+QEMU_AUDIO_DAC_FIXED_CHANNELS=4 \
+QEMU_AUDIO_DAC_FIXED_FMT=f32 \
/usr/bin/qemu-system-i386 \
-name QEMUGuest1 \
-S \
diff --git a/tests/qemuxml2argvdata/audio-oss-best.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-oss-best.x86_64-latest.args
index fe78b3a738..3cff02e1ba 100644
--- a/tests/qemuxml2argvdata/audio-oss-best.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/audio-oss-best.x86_64-latest.args
@@ -33,7 +33,10 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
"file":"libvirt-1-storage"}' \
-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
--audiodev id=audio1,driver=oss,in.dev=/dev/dsp0,out.dev=/dev/dsp1 \
+-audiodev id=audio1,driver=oss,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,\
+out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,\
+out.channels=4,out.format=f32 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-oss-best.xml
b/tests/qemuxml2argvdata/audio-oss-best.xml
index 0947bd6def..6904bcc93b 100644
--- a/tests/qemuxml2argvdata/audio-oss-best.xml
+++ b/tests/qemuxml2argvdata/audio-oss-best.xml
@@ -31,8 +31,12 @@
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<audio id='1' type='oss'>
- <input dev='/dev/dsp0'/>
- <output dev='/dev/dsp1'/>
+ <input mixingEngine='yes' fixedSettings='yes'
voices='1'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
</audio>
<memballoon model='none'/>
</devices>
diff --git a/tests/qemuxml2argvdata/audio-oss-full.args
b/tests/qemuxml2argvdata/audio-oss-full.args
new file mode 100644
index 0000000000..e6a7bb4af8
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-oss-full.args
@@ -0,0 +1,31 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=oss \
+QEMU_OSS_ADC_DEV=/dev/dsp0 \
+QEMU_OSS_DAC_DEV=/dev/dsp1 \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-oss-full.err
b/tests/qemuxml2argvdata/audio-oss-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-oss-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-oss-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-oss-full.x86_64-latest.args
new file mode 100644
index 0000000000..cf9f5077d1
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-oss-full.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=oss,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-oss-full.xml
b/tests/qemuxml2argvdata/audio-oss-full.xml
new file mode 100644
index 0000000000..52d8810650
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-oss-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='oss'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-pulseaudio-best.args
b/tests/qemuxml2argvdata/audio-pulseaudio-best.args
new file mode 100644
index 0000000000..ad5718b242
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-pulseaudio-best.args
@@ -0,0 +1,39 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=pa \
+QEMU_AUDIO_ADC_FIXED_SETTINGS=on \
+QEMU_AUDIO_ADC_VOICES=1 \
+QEMU_AUDIO_ADC_FIXED_FREQ=44100 \
+QEMU_AUDIO_ADC_FIXED_CHANNELS=2 \
+QEMU_AUDIO_ADC_FIXED_FMT=s16 \
+QEMU_AUDIO_DAC_FIXED_SETTINGS=on \
+QEMU_AUDIO_DAC_VOICES=2 \
+QEMU_AUDIO_DAC_FIXED_FREQ=22050 \
+QEMU_AUDIO_DAC_FIXED_CHANNELS=4 \
+QEMU_AUDIO_DAC_FIXED_FMT=f32 \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-pulseaudio-best.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-pulseaudio-best.x86_64-latest.args
new file mode 100644
index 0000000000..f6ccde6d59
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-pulseaudio-best.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=pa,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,\
+out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,\
+out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-pulseaudio-best.xml
b/tests/qemuxml2argvdata/audio-pulseaudio-best.xml
new file mode 100644
index 0000000000..b75e336db3
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-pulseaudio-best.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='pulseaudio'>
+ <input mixingEngine='yes' fixedSettings='yes'
voices='1'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-pulseaudio-full.args
b/tests/qemuxml2argvdata/audio-pulseaudio-full.args
new file mode 100644
index 0000000000..af274e4328
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-pulseaudio-full.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=pa \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-pulseaudio-full.err
b/tests/qemuxml2argvdata/audio-pulseaudio-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-pulseaudio-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-pulseaudio-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-pulseaudio-full.x86_64-latest.args
new file mode 100644
index 0000000000..493945e608
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-pulseaudio-full.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=pa,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-pulseaudio-full.xml
b/tests/qemuxml2argvdata/audio-pulseaudio-full.xml
new file mode 100644
index 0000000000..87ceefbab0
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-pulseaudio-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='pulseaudio'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-sdl-best.args
b/tests/qemuxml2argvdata/audio-sdl-best.args
index 6aca7037a8..abdf655fe1 100644
--- a/tests/qemuxml2argvdata/audio-sdl-best.args
+++ b/tests/qemuxml2argvdata/audio-sdl-best.args
@@ -7,6 +7,16 @@ XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
QEMU_AUDIO_DRV=sdl \
+QEMU_AUDIO_ADC_FIXED_SETTINGS=on \
+QEMU_AUDIO_ADC_VOICES=1 \
+QEMU_AUDIO_ADC_FIXED_FREQ=44100 \
+QEMU_AUDIO_ADC_FIXED_CHANNELS=2 \
+QEMU_AUDIO_ADC_FIXED_FMT=s16 \
+QEMU_AUDIO_DAC_FIXED_SETTINGS=on \
+QEMU_AUDIO_DAC_VOICES=2 \
+QEMU_AUDIO_DAC_FIXED_FREQ=22050 \
+QEMU_AUDIO_DAC_FIXED_CHANNELS=4 \
+QEMU_AUDIO_DAC_FIXED_FMT=f32 \
SDL_AUDIODRIVER=pulseaudio \
/usr/bin/qemu-system-i386 \
-name QEMUGuest1 \
diff --git a/tests/qemuxml2argvdata/audio-sdl-best.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-sdl-best.x86_64-latest.args
index 53b29b9843..d8893a7a4b 100644
--- a/tests/qemuxml2argvdata/audio-sdl-best.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/audio-sdl-best.x86_64-latest.args
@@ -34,7 +34,10 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
"file":"libvirt-1-storage"}' \
-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
--audiodev id=audio1,driver=sdl \
+-audiodev id=audio1,driver=sdl,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,\
+out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,\
+out.channels=4,out.format=f32 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-sdl-best.xml
b/tests/qemuxml2argvdata/audio-sdl-best.xml
index d6835a22bc..4e3f8a5c61 100644
--- a/tests/qemuxml2argvdata/audio-sdl-best.xml
+++ b/tests/qemuxml2argvdata/audio-sdl-best.xml
@@ -30,7 +30,14 @@
<controller type='pci' index='0' model='pci-root'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <audio id='1' type='sdl' driver='pulseaudio'/>
+ <audio id='1' type='sdl' driver='pulseaudio'>
+ <input mixingEngine='yes' fixedSettings='yes'
voices='1'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
<memballoon model='none'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/audio-sdl-full.args
b/tests/qemuxml2argvdata/audio-sdl-full.args
new file mode 100644
index 0000000000..6aca7037a8
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-sdl-full.args
@@ -0,0 +1,30 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=sdl \
+SDL_AUDIODRIVER=pulseaudio \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-sdl-full.err
b/tests/qemuxml2argvdata/audio-sdl-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-sdl-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-sdl-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-sdl-full.x86_64-latest.args
new file mode 100644
index 0000000000..722aa33fa4
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-sdl-full.x86_64-latest.args
@@ -0,0 +1,43 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+SDL_AUDIODRIVER=pulseaudio \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=sdl,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-sdl-full.xml
b/tests/qemuxml2argvdata/audio-sdl-full.xml
new file mode 100644
index 0000000000..519cda12e3
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-sdl-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='sdl' driver='pulseaudio'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-spice-best.args
b/tests/qemuxml2argvdata/audio-spice-best.args
new file mode 100644
index 0000000000..6e2ffc9e1e
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-spice-best.args
@@ -0,0 +1,39 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=spice \
+QEMU_AUDIO_ADC_FIXED_SETTINGS=on \
+QEMU_AUDIO_ADC_VOICES=1 \
+QEMU_AUDIO_ADC_FIXED_FREQ=44100 \
+QEMU_AUDIO_ADC_FIXED_CHANNELS=2 \
+QEMU_AUDIO_ADC_FIXED_FMT=s16 \
+QEMU_AUDIO_DAC_FIXED_SETTINGS=on \
+QEMU_AUDIO_DAC_VOICES=2 \
+QEMU_AUDIO_DAC_FIXED_FREQ=22050 \
+QEMU_AUDIO_DAC_FIXED_CHANNELS=4 \
+QEMU_AUDIO_DAC_FIXED_FMT=f32 \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-spice-best.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-spice-best.x86_64-latest.args
new file mode 100644
index 0000000000..b23ff38f23
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-spice-best.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=spice,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.frequency=44100,in.channels=2,in.format=s16,\
+out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.frequency=22050,\
+out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-spice-best.xml
b/tests/qemuxml2argvdata/audio-spice-best.xml
new file mode 100644
index 0000000000..a53586032a
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-spice-best.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='spice'>
+ <input mixingEngine='yes' fixedSettings='yes'
voices='1'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/audio-spice-full.args
b/tests/qemuxml2argvdata/audio-spice-full.args
new file mode 100644
index 0000000000..a7a85959d6
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-spice-full.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=spice \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/cdrom,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
diff --git a/tests/qemuxml2argvdata/audio-spice-full.err
b/tests/qemuxml2argvdata/audio-spice-full.err
new file mode 100644
index 0000000000..d9ceac7226
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-spice-full.err
@@ -0,0 +1 @@
+unsupported configuration: setting audio buffer length is not supported with this QEMU
diff --git a/tests/qemuxml2argvdata/audio-spice-full.x86_64-latest.args
b/tests/qemuxml2argvdata/audio-spice-full.x86_64-latest.args
new file mode 100644
index 0000000000..4419ad2cdb
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-spice-full.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-i386 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object memory-backend-ram,id=pc.ram,size=224395264 \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"host_cdrom","filename":"/dev/cdrom",\
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":true,"driver":"raw",\
+"file":"libvirt-1-storage"}' \
+-device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0,bootindex=1 \
+-audiodev id=audio1,driver=spice,in.mixing-engine=on,in.fixed-settings=on,\
+in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,\
+in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,\
+out.buffer-length=200,out.frequency=22050,out.channels=4,out.format=f32 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/audio-spice-full.xml
b/tests/qemuxml2argvdata/audio-spice-full.xml
new file mode 100644
index 0000000000..3ef3e431ac
--- /dev/null
+++ b/tests/qemuxml2argvdata/audio-spice-full.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='cdrom'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/cdrom'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='spice'>
+ <input mixingEngine='yes' fixedSettings='yes' voices='1'
bufferLength='100'>
+ <settings frequency='44100' channels='2'
format='s16'/>
+ </input>
+ <output mixingEngine='yes' fixedSettings='yes'
voices='2' bufferLength='200'>
+ <settings frequency='22050' channels='4'
format='f32'/>
+ </output>
+ </audio>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 883f840c1a..c1c1d96af4 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1065,11 +1065,44 @@ mymain(void)
DO_TEST_CAPS_LATEST("audio-file-minimal");
/* Best <audio> still compat with old ENV */
+ DO_TEST("audio-none-best", NONE);
+ DO_TEST("audio-alsa-best", NONE);
+ DO_TEST("audio-coreaudio-best", NONE);
DO_TEST("audio-oss-best", NONE);
+ DO_TEST("audio-pulseaudio-best", NONE);
DO_TEST("audio-sdl-best", NONE);
+ DO_TEST("audio-spice-best", NONE);
+ DO_TEST("audio-file-best", NONE);
+ DO_TEST_CAPS_LATEST("audio-none-best");
+ DO_TEST_CAPS_LATEST("audio-alsa-best");
+ DO_TEST_CAPS_LATEST("audio-coreaudio-best");
DO_TEST_CAPS_LATEST("audio-oss-best");
+ DO_TEST_CAPS_LATEST("audio-pulseaudio-best");
DO_TEST_CAPS_LATEST("audio-sdl-best");
+ DO_TEST_CAPS_LATEST("audio-spice-best");
+ DO_TEST_CAPS_LATEST("audio-file-best");
+
+ /* Full <audio> only compat with new QEMU -audiodev args */
+ DO_TEST_PARSE_ERROR("audio-none-full", NONE);
+ DO_TEST_PARSE_ERROR("audio-alsa-full", NONE);
+ DO_TEST_PARSE_ERROR("audio-coreaudio-full", NONE);
+ DO_TEST_PARSE_ERROR("audio-jack-full", NONE);
+ DO_TEST_PARSE_ERROR("audio-oss-full", NONE);
+ DO_TEST_PARSE_ERROR("audio-pulseaudio-full", NONE);
+ DO_TEST_PARSE_ERROR("audio-sdl-full", NONE);
+ DO_TEST_PARSE_ERROR("audio-spice-full", NONE);
+ DO_TEST_PARSE_ERROR("audio-file-full", NONE);
+
+ DO_TEST_CAPS_LATEST("audio-none-full");
+ DO_TEST_CAPS_LATEST("audio-alsa-full");
+ DO_TEST_CAPS_LATEST("audio-coreaudio-full");
+ DO_TEST_CAPS_LATEST("audio-jack-full");
+ DO_TEST_CAPS_LATEST("audio-oss-full");
+ DO_TEST_CAPS_LATEST("audio-pulseaudio-full");
+ DO_TEST_CAPS_LATEST("audio-sdl-full");
+ DO_TEST_CAPS_LATEST("audio-spice-full");
+ DO_TEST_CAPS_LATEST("audio-file-full");
/* Multiple backends not supported with ENV */
DO_TEST_PARSE_ERROR("audio-many-backends", NONE);
diff --git a/tests/qemuxml2xmloutdata/audio-alsa-best.xml
b/tests/qemuxml2xmloutdata/audio-alsa-best.xml
new file mode 120000
index 0000000000..2d0865c8ee
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-alsa-best.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-alsa-best.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-alsa-full.xml
b/tests/qemuxml2xmloutdata/audio-alsa-full.xml
new file mode 120000
index 0000000000..61de7e7b33
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-alsa-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-alsa-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-coreaudio-best.xml
b/tests/qemuxml2xmloutdata/audio-coreaudio-best.xml
new file mode 120000
index 0000000000..13e96938d9
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-coreaudio-best.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-coreaudio-best.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-coreaudio-full.xml
b/tests/qemuxml2xmloutdata/audio-coreaudio-full.xml
new file mode 120000
index 0000000000..b00cc14e29
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-coreaudio-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-coreaudio-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-file-best.xml
b/tests/qemuxml2xmloutdata/audio-file-best.xml
new file mode 120000
index 0000000000..bb836545a0
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-file-best.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-file-best.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-file-full.xml
b/tests/qemuxml2xmloutdata/audio-file-full.xml
new file mode 120000
index 0000000000..6e4b032b40
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-file-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-file-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-jack-full.xml
b/tests/qemuxml2xmloutdata/audio-jack-full.xml
new file mode 120000
index 0000000000..813ccded71
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-jack-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-jack-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-none-best.xml
b/tests/qemuxml2xmloutdata/audio-none-best.xml
new file mode 120000
index 0000000000..7606228da6
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-none-best.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-none-best.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-none-full.xml
b/tests/qemuxml2xmloutdata/audio-none-full.xml
new file mode 120000
index 0000000000..a5a7ec6932
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-none-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-none-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-oss-full.xml
b/tests/qemuxml2xmloutdata/audio-oss-full.xml
new file mode 120000
index 0000000000..6073f438a0
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-oss-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-oss-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-pulseaudio-best.xml
b/tests/qemuxml2xmloutdata/audio-pulseaudio-best.xml
new file mode 120000
index 0000000000..d77efcd7bf
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-pulseaudio-best.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-pulseaudio-best.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-pulseaudio-full.xml
b/tests/qemuxml2xmloutdata/audio-pulseaudio-full.xml
new file mode 120000
index 0000000000..c12f36702d
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-pulseaudio-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-pulseaudio-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-sdl-full.xml
b/tests/qemuxml2xmloutdata/audio-sdl-full.xml
new file mode 120000
index 0000000000..faeeb0ef35
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-sdl-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-sdl-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-spice-best.xml
b/tests/qemuxml2xmloutdata/audio-spice-best.xml
new file mode 120000
index 0000000000..0e52fb5460
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-spice-best.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-spice-best.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/audio-spice-full.xml
b/tests/qemuxml2xmloutdata/audio-spice-full.xml
new file mode 120000
index 0000000000..088605f0bc
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/audio-spice-full.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-spice-full.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 3d521108b0..f25a0902c9 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1474,8 +1474,25 @@ mymain(void)
DO_TEST("audio-file-minimal", NONE);
/* Best <audio> still compat with old ENV */
+ DO_TEST("audio-none-best", NONE);
+ DO_TEST("audio-alsa-best", NONE);
+ DO_TEST("audio-coreaudio-best", NONE);
DO_TEST("audio-oss-best", NONE);
+ DO_TEST("audio-pulseaudio-best", NONE);
DO_TEST("audio-sdl-best", NONE);
+ DO_TEST("audio-spice-best", NONE);
+ DO_TEST("audio-file-best", NONE);
+
+ /* Full <audio> only compat with new QEMU -audiodev args */
+ DO_TEST("audio-none-full", QEMU_CAPS_AUDIODEV);
+ DO_TEST("audio-alsa-full", QEMU_CAPS_AUDIODEV);
+ DO_TEST("audio-coreaudio-full", QEMU_CAPS_AUDIODEV);
+ DO_TEST("audio-jack-full", QEMU_CAPS_AUDIODEV);
+ DO_TEST("audio-oss-full", QEMU_CAPS_AUDIODEV);
+ DO_TEST("audio-pulseaudio-full", QEMU_CAPS_AUDIODEV);
+ DO_TEST("audio-sdl-full", QEMU_CAPS_AUDIODEV);
+ DO_TEST("audio-spice-full", QEMU_CAPS_AUDIODEV);
+ DO_TEST("audio-file-full", QEMU_CAPS_AUDIODEV);
DO_TEST_CAPS_LATEST("audio-many-backends");
--
2.29.2