[PATCH 18/20] qemu: validate: Remove unreachable checks for QEMU_CAPS_AUDIODEV

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We now only support qemu versions which already have the capability so
we can remove this now unused code.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_validate.c | 86 ----------------------------------------
 1 file changed, 86 deletions(-)

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 764d5b029e..4016b1b6f0 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1344,13 +1344,6 @@ qemuValidateDomainDef(const virDomainDef *def,
         }
     }

-    if (def->naudios > 1 &&
-        !virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("only one audio backend is supported with this QEMU binary"));
-        return -1;
-    }
-
     return 0;
 }

@@ -4530,25 +4523,6 @@ qemuValidateDomainDeviceDefAudio(virDomainAudioDef *audio,
                                  const virDomainDef *def,
                                  virQEMUCaps *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 (audio->type) {
     case VIR_DOMAIN_AUDIO_TYPE_NONE:
         break;
@@ -4557,78 +4531,18 @@ qemuValidateDomainDeviceDefAudio(virDomainAudioDef *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;
-            }
-            if (audio->backend.coreaudio.input.bufferCount) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("setting audio buffer count is not supported with this QEMU"));
-                return -1;
-            }
-        }
         break;

     case VIR_DOMAIN_AUDIO_TYPE_JACK:
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("'jack' audio backend is not supported with this QEMU"));
-            return -1;
-        }
         break;

     case VIR_DOMAIN_AUDIO_TYPE_OSS:
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) {
-            if (audio->backend.oss.input.bufferCount !=
-                audio->backend.oss.output.bufferCount) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("setting audio buffer count is not supported with this QEMU"));
-                return -1;
-            }
-        }
         break;

     case VIR_DOMAIN_AUDIO_TYPE_PULSEAUDIO:
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) {
-            if (audio->backend.pulseaudio.input.streamName ||
-                audio->backend.pulseaudio.output.streamName) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("setting audio stream name is not supported with this QEMU"));
-                return -1;
-            }
-
-            if (audio->backend.pulseaudio.input.latency ||
-                audio->backend.pulseaudio.output.latency) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("setting audio latency is not supported with this QEMU"));
-                return -1;
-            }
-
-            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;
-            }
-
-            if (audio->backend.sdl.input.bufferCount ||
-                audio->backend.sdl.output.bufferCount) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("setting audio buffer count is not supported with this QEMU"));
-                return -1;
-            }
-        }
         break;

     case VIR_DOMAIN_AUDIO_TYPE_SPICE:
-- 
2.36.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux