From fcb53e8ee13b45c8fefa452e973ed12d470a4a6f Mon Sep 17 00:00:00 2001 From: Filip Alac Date: Tue, 22 May 2018 13:12:32 +0200 Subject: [PATCH] conf: Introduce codec type 'output' Introduce support for codec type 'output' ('hda-output' in QEMU) for ich6 and ich9 sound devices, which only advertises a line-out in the guest. This has been available in QEMU since 0.14. Signed-off-by: Filip Alac Reviewed-by: Erik Skultety --- docs/formatdomain.html.in | 15 ++++++++++++--- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 3 ++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0d0fd3b9f3..665d0f2529 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -7387,9 +7387,18 @@ qemu-kvm -net nic,model=? /dev/null with ich6 model can have optional sub-elements <codec> to attach various audio codecs to the audio device. If not specified, a default codec - will be attached to allow playback and recording. Valid values - are 'duplex' (advertise a line-in and a line-out) and 'micro' - (advertise a speaker and a microphone). + will be attached to allow playback and recording. +

+

+ Valid values are: +

+

+

    +
  • 'duplex' - advertise a line-in and a line-out
  • +
  • 'micro' - advertise a speaker and a microphone
  • +
  • 'output' - advertise a line-out + Since 4.4.0
  • +

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 71ac3d079c..f16e157397 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3824,6 +3824,7 @@
         
           duplex
           micro
+          output
         
       
     
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3689ac0a82..f12c87d217 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -529,7 +529,8 @@ VIR_ENUM_IMPL(virDomainSmartcard, VIR_DOMAIN_SMARTCARD_TYPE_LAST,
 
 VIR_ENUM_IMPL(virDomainSoundCodec, VIR_DOMAIN_SOUND_CODEC_TYPE_LAST,
               "duplex",
-              "micro")
+              "micro",
+              "output")
 
 VIR_ENUM_IMPL(virDomainSoundModel, VIR_DOMAIN_SOUND_MODEL_LAST,
               "sb16",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a78fdee40c..ee3285a97c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1335,6 +1335,7 @@ struct _virDomainInputDef {
 typedef enum {
     VIR_DOMAIN_SOUND_CODEC_TYPE_DUPLEX,
     VIR_DOMAIN_SOUND_CODEC_TYPE_MICRO,
+    VIR_DOMAIN_SOUND_CODEC_TYPE_OUTPUT,
 
     VIR_DOMAIN_SOUND_CODEC_TYPE_LAST
 } virDomainSoundCodecType;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e1f430aafe..dadc82d873 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -139,7 +139,8 @@ VIR_ENUM_DECL(qemuSoundCodec)
 
 VIR_ENUM_IMPL(qemuSoundCodec, VIR_DOMAIN_SOUND_CODEC_TYPE_LAST,
               "hda-duplex",
-              "hda-micro");
+              "hda-micro",
+              "hda-output");
 
 VIR_ENUM_DECL(qemuControllerModelUSB)