]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: wire up support for common audio backend settings
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 2 Mar 2021 17:22:47 +0000 (17:22 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 9 Mar 2021 22:58:45 +0000 (22:58 +0000)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
78 files changed:
src/qemu/qemu_command.c
src/qemu/qemu_validate.c
tests/qemuxml2argvdata/audio-alsa-best.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-alsa-best.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-alsa-best.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-alsa-full.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-alsa-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-alsa-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-alsa-full.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-coreaudio-best.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-coreaudio-best.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-coreaudio-best.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-coreaudio-full.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-coreaudio-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-coreaudio-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-coreaudio-full.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-file-best.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-file-best.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-file-best.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-file-full.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-file-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-file-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-file-full.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-jack-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-jack-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-jack-full.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-none-best.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-none-best.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-none-best.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-none-full.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-none-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-none-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-none-full.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-oss-best.args
tests/qemuxml2argvdata/audio-oss-best.x86_64-latest.args
tests/qemuxml2argvdata/audio-oss-best.xml
tests/qemuxml2argvdata/audio-oss-full.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-oss-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-oss-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-oss-full.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-pulseaudio-best.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-pulseaudio-best.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-pulseaudio-best.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-pulseaudio-full.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-pulseaudio-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-pulseaudio-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-pulseaudio-full.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-sdl-best.args
tests/qemuxml2argvdata/audio-sdl-best.x86_64-latest.args
tests/qemuxml2argvdata/audio-sdl-best.xml
tests/qemuxml2argvdata/audio-sdl-full.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-sdl-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-sdl-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-sdl-full.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-spice-best.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-spice-best.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-spice-best.xml [new file with mode: 0644]
tests/qemuxml2argvdata/audio-spice-full.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-spice-full.err [new file with mode: 0644]
tests/qemuxml2argvdata/audio-spice-full.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/audio-spice-full.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/audio-alsa-best.xml [new symlink]
tests/qemuxml2xmloutdata/audio-alsa-full.xml [new symlink]
tests/qemuxml2xmloutdata/audio-coreaudio-best.xml [new symlink]
tests/qemuxml2xmloutdata/audio-coreaudio-full.xml [new symlink]
tests/qemuxml2xmloutdata/audio-file-best.xml [new symlink]
tests/qemuxml2xmloutdata/audio-file-full.xml [new symlink]
tests/qemuxml2xmloutdata/audio-jack-full.xml [new symlink]
tests/qemuxml2xmloutdata/audio-none-best.xml [new symlink]
tests/qemuxml2xmloutdata/audio-none-full.xml [new symlink]
tests/qemuxml2xmloutdata/audio-oss-full.xml [new symlink]
tests/qemuxml2xmloutdata/audio-pulseaudio-best.xml [new symlink]
tests/qemuxml2xmloutdata/audio-pulseaudio-full.xml [new symlink]
tests/qemuxml2xmloutdata/audio-sdl-full.xml [new symlink]
tests/qemuxml2xmloutdata/audio-spice-best.xml [new symlink]
tests/qemuxml2xmloutdata/audio-spice-full.xml [new symlink]
tests/qemuxml2xmltest.c

index ceddf1fb340c92df50c14e71f1baaa1582aa9464..bca1888dff0cec397fcc29ce84250c877617259a 100644 (file)
@@ -7587,6 +7587,34 @@ qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd,
     return 0;
 }
 
+static void
+qemuBuildAudioCommonArg(virBufferPtr buf,
+                        const char *prefix,
+                        virDomainAudioIOCommonPtr 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,
+                        virDomainAudioIOCommonPtr 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;
index a2cf30210ecd860ed589c64497411c50569355e3..ee9592aa34110b6835e72ac5e66e03bbfd5b7469 100644 (file)
@@ -4176,6 +4176,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;
@@ -4184,6 +4203,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:
@@ -4198,9 +4224,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 (file)
index 0000000..4461fc6
--- /dev/null
@@ -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 (file)
index 0000000..5f84dcc
--- /dev/null
@@ -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 (file)
index 0000000..cefcc47
--- /dev/null
@@ -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 (file)
index 0000000..01fe6e2
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..6ade7ef
--- /dev/null
@@ -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 (file)
index 0000000..2cd488a
--- /dev/null
@@ -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 (file)
index 0000000..f8250df
--- /dev/null
@@ -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 (file)
index 0000000..93166f2
--- /dev/null
@@ -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 (file)
index 0000000..8a79404
--- /dev/null
@@ -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 (file)
index 0000000..c4d502b
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..bc6c9e9
--- /dev/null
@@ -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 (file)
index 0000000..6714979
--- /dev/null
@@ -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 (file)
index 0000000..bd73a5b
--- /dev/null
@@ -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 (file)
index 0000000..546e4de
--- /dev/null
@@ -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 (file)
index 0000000..0617dbb
--- /dev/null
@@ -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 (file)
index 0000000..fd504f5
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..1f1f05b
--- /dev/null
@@ -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 (file)
index 0000000..c695a17
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..96856cd
--- /dev/null
@@ -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 (file)
index 0000000..129bf50
--- /dev/null
@@ -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 (file)
index 0000000..6116734
--- /dev/null
@@ -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 (file)
index 0000000..005f26d
--- /dev/null
@@ -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 (file)
index 0000000..df79f70
--- /dev/null
@@ -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 (file)
index 0000000..00c6e37
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..d303a16
--- /dev/null
@@ -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 (file)
index 0000000..f795a24
--- /dev/null
@@ -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>
index e6a7bb4af8189928117234595963e514884ee223..054222992fd340a39c367dc8ad2ea16993e496ea 100644 (file)
@@ -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 \
index fe78b3a738229c1281944d7058f018d051dbbf86..3cff02e1ba08957ca6cd026914c912ff62e41087 100644 (file)
@@ -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
index 0947bd6def439b787e10fc7cda4767a00f204659..6904bcc93b08559369db6ea9aaf5464da1905fac 100644 (file)
     <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 (file)
index 0000000..e6a7bb4
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..cf9f507
--- /dev/null
@@ -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 (file)
index 0000000..52d8810
--- /dev/null
@@ -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 (file)
index 0000000..ad5718b
--- /dev/null
@@ -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 (file)
index 0000000..f6ccde6
--- /dev/null
@@ -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 (file)
index 0000000..b75e336
--- /dev/null
@@ -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 (file)
index 0000000..af274e4
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..493945e
--- /dev/null
@@ -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 (file)
index 0000000..87ceefb
--- /dev/null
@@ -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>
index 6aca7037a8f8ff7bba5ef2487f781c3e7a289c73..abdf655fe13baf8a29d0e66f7dfb183d2e04d632 100644 (file)
@@ -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 \
index 53b29b98433053520f8dee285ba429c47671353d..d8893a7a4bc2c410b6f6848ab2bcc215d52f681e 100644 (file)
@@ -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
index d6835a22bc2a68e8c59533944fa32236488d0c69..4e3f8a5c6190c3e47d877e2541882586444ae3e9 100644 (file)
     <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 (file)
index 0000000..6aca703
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..722aa33
--- /dev/null
@@ -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 (file)
index 0000000..519cda1
--- /dev/null
@@ -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 (file)
index 0000000..6e2ffc9
--- /dev/null
@@ -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 (file)
index 0000000..b23ff38
--- /dev/null
@@ -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 (file)
index 0000000..a535860
--- /dev/null
@@ -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 (file)
index 0000000..a7a8595
--- /dev/null
@@ -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 (file)
index 0000000..d9ceac7
--- /dev/null
@@ -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 (file)
index 0000000..4419ad2
--- /dev/null
@@ -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 (file)
index 0000000..3ef3e43
--- /dev/null
@@ -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>
index 468c69e55ffef869952ba0a6eabf4cc19b15847d..29054ba16849b1ce734d1702154765d414ed43a7 100644 (file)
@@ -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 (symlink)
index 0000000..2d0865c
--- /dev/null
@@ -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 (symlink)
index 0000000..61de7e7
--- /dev/null
@@ -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 (symlink)
index 0000000..13e9693
--- /dev/null
@@ -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 (symlink)
index 0000000..b00cc14
--- /dev/null
@@ -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 (symlink)
index 0000000..bb83654
--- /dev/null
@@ -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 (symlink)
index 0000000..6e4b032
--- /dev/null
@@ -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 (symlink)
index 0000000..813ccde
--- /dev/null
@@ -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 (symlink)
index 0000000..7606228
--- /dev/null
@@ -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 (symlink)
index 0000000..a5a7ec6
--- /dev/null
@@ -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 (symlink)
index 0000000..6073f43
--- /dev/null
@@ -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 (symlink)
index 0000000..d77efcd
--- /dev/null
@@ -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 (symlink)
index 0000000..c12f367
--- /dev/null
@@ -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 (symlink)
index 0000000..faeeb0e
--- /dev/null
@@ -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 (symlink)
index 0000000..0e52fb5
--- /dev/null
@@ -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 (symlink)
index 0000000..088605f
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/audio-spice-full.xml
\ No newline at end of file
index 3d521108b025218178391716c09fb42a4a7e6b5e..f25a0902c975ef39331ef21d3ec1bb7d1292c0fb 100644 (file)
@@ -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");