[libvirt] [PATCH] qemu: Add support for -device hda-output (disable line-in)
by Filip Alac
Add support for hda 'output' codec for ich6 and ich9 sound devices,
which allow us to disable line-in for guest.
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1126641
Signed-off-by: Filip Alac <filipalac(a)gmail.com>
---
docs/formatdomain.html.in | 5 +++--
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 5 ++++-
tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
tests/qemustatusxml2xmldata/migration-in-params-in.xml | 1 +
tests/qemustatusxml2xmldata/migration-out-nbd-in.xml | 1 +
tests/qemustatusxml2xmldata/migration-out-nbd-out.xml | 1 +
tests/qemustatusxml2xmldata/migration-out-params-in.xml | 1 +
tests/qemustatusxml2xmldata/modern-in.xml | 1 +
tests/qemuxml2argvdata/sound-device.args | 2 ++
tests/qemuxml2argvdata/sound-device.xml | 2 ++
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmloutdata/sound-device.xml | 2 ++
35 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 0d0fd3b9..8ab45e1c 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7388,8 +7388,9 @@ qemu-kvm -net nic,model=? /dev/null
sub-elements <code><codec></code> 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).
+ are 'duplex' (advertise a line-in and a line-out), 'micro'
+ (advertise a speaker and a microphone) and 'output'
+ (advertise a speaker).
</p>
<pre>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 71ac3d07..f16e1573 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3824,6 +3824,7 @@
<choice>
<value>duplex</value>
<value>micro</value>
+ <value>output</value>
</choice>
</attribute>
</element>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3689ac0a..f12c87d2 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 a78fdee4..ee3285a9 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_capabilities.c b/src/qemu/qemu_capabilities.c
index a5cb24fe..ba085a9e 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -486,6 +486,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
/* 300 */
"sdl-gl",
+ "hda-output",
);
@@ -1015,6 +1016,7 @@ struct virQEMUCapsStringFlags virQEMUCapsEvents[] = {
struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "hda-duplex", QEMU_CAPS_HDA_DUPLEX },
{ "hda-micro", QEMU_CAPS_HDA_MICRO },
+ { "hda-output", QEMU_CAPS_HDA_OUTPUT},
{ "ccid-card-emulated", QEMU_CAPS_CCID_EMULATED },
{ "ccid-card-passthru", QEMU_CAPS_CCID_PASSTHRU },
{ "piix3-usb-uhci", QEMU_CAPS_PIIX3_USB_UHCI },
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index d23c34c2..3e9a8b30 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -470,6 +470,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 300 */
QEMU_CAPS_SDL_GL, /* -sdl gl */
+ QEMU_CAPS_HDA_OUTPUT, /* -device hda-output*/
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c4237339..aee5bde5 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)
@@ -4172,6 +4173,8 @@ qemuSoundCodecTypeToCaps(int type)
return QEMU_CAPS_HDA_DUPLEX;
case VIR_DOMAIN_SOUND_CODEC_TYPE_MICRO:
return QEMU_CAPS_HDA_MICRO;
+ case VIR_DOMAIN_SOUND_CODEC_TYPE_OUTPUT:
+ return QEMU_CAPS_HDA_OUTPUT;
default:
return -1;
}
diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml
index e7c2e9a1..2b13ebc1 100644
--- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml
@@ -105,6 +105,7 @@
<flag name='query-cpu-definitions'/>
<flag name='kernel-irqchip'/>
<flag name='isa-serial'/>
+ <flag name='hda-output'/>
<version>1005003</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>46523</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml
index e57dec32..ecd31293 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml
@@ -110,6 +110,7 @@
<flag name='query-cpu-definitions'/>
<flag name='kernel-irqchip'/>
<flag name='isa-serial'/>
+ <flag name='hda-output'/>
<version>1006000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>44752</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml
index 39ec8f9b..c31a9721 100644
--- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml
@@ -112,6 +112,7 @@
<flag name='query-cpu-definitions'/>
<flag name='kernel-irqchip'/>
<flag name='isa-serial'/>
+ <flag name='hda-output'/>
<version>1007000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>50196</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml
index afe0882d..07cb2a37 100644
--- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml
@@ -128,6 +128,7 @@
<flag name='query-named-block-nodes'/>
<flag name='kernel-irqchip'/>
<flag name='isa-serial'/>
+ <flag name='hda-output'/>
<version>2001001</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>58992</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml
index 59043068..e11c1122 100644
--- a/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml
@@ -155,6 +155,7 @@
<flag name='disk-write-cache'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2010000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>303541</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
index 2912c8d6..21d91c8d 100644
--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
@@ -154,6 +154,7 @@
<flag name='disk-write-cache'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2010000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>382824</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
index 77ca3013..7821144e 100644
--- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
@@ -197,6 +197,7 @@
<flag name='disk-write-cache'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2010000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>344938</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml
index cabe4f2f..e4f22684 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml
@@ -162,6 +162,7 @@
<flag name='qom-list-properties'/>
<flag name='memory-backend-file.discard-data'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>343099</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
index bffe3b3b..3e393633 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
@@ -159,6 +159,7 @@
<flag name='qom-list-properties'/>
<flag name='memory-backend-file.discard-data'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>419968</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
index 4247afeb..35eadc18 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
@@ -200,6 +200,7 @@
<flag name='qom-list-properties'/>
<flag name='memory-backend-file.discard-data'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>390813</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
index 871eb5e4..56861723 100644
--- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
@@ -154,6 +154,7 @@
<flag name='virtio-gpu.max_outputs'/>
<flag name='isa-serial'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2004000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>75406</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
index 90dce5a7..e86fce9f 100644
--- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
@@ -160,6 +160,7 @@
<flag name='virtio-gpu.max_outputs'/>
<flag name='isa-serial'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2005000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>216528</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml
index 42985489..e5268eda 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml
@@ -142,6 +142,7 @@
<flag name='dump-completed'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2006000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>228241</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
index 07cdc49b..7e514be6 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml
@@ -137,6 +137,7 @@
<flag name='dump-completed'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2006000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>263005</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
index 4c6371a6..0d542b87 100644
--- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
@@ -172,6 +172,7 @@
<flag name='dump-completed'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2006000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>227332</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
index c322d18d..5795bc95 100644
--- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml
@@ -177,6 +177,7 @@
<flag name='disk-write-cache'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2007000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>239029</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
index 7c329ad4..bd467d27 100644
--- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml
@@ -179,6 +179,7 @@
<flag name='disk-write-cache'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2008000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>255684</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
index cfc94050..1e6d0cc3 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
@@ -146,6 +146,7 @@
<flag name='disk-write-cache'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2009000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>346538</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
index 0701c244..7e45b311 100644
--- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
@@ -192,6 +192,7 @@
<flag name='disk-write-cache'/>
<flag name='nbd-tls'/>
<flag name='sdl-gl'/>
+ <flag name='hda-output'/>
<version>2009000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>320947</microcodeVersion>
diff --git a/tests/qemustatusxml2xmldata/migration-in-params-in.xml b/tests/qemustatusxml2xmldata/migration-in-params-in.xml
index b0caa34e..03f18b4f 100644
--- a/tests/qemustatusxml2xmldata/migration-in-params-in.xml
+++ b/tests/qemustatusxml2xmldata/migration-in-params-in.xml
@@ -236,6 +236,7 @@
<flag name='iscsi.password-secret'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
+ <flag name='hda-output'/>
</qemuCaps>
<job type='none' async='migration in' phase='prepare' flags='0x900'>
<migParams>
diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-in.xml b/tests/qemustatusxml2xmldata/migration-out-nbd-in.xml
index 6d87c1ec..636accf0 100644
--- a/tests/qemustatusxml2xmldata/migration-out-nbd-in.xml
+++ b/tests/qemustatusxml2xmldata/migration-out-nbd-in.xml
@@ -229,6 +229,7 @@
<flag name='iscsi.password-secret'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
+ <flag name='hda-output'/>
</qemuCaps>
<job type='none' async='migration out' phase='perform3'>
<disk dev='vdb' migrating='yes'/>
diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
index 05da1f81..315d8e4c 100644
--- a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
+++ b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
@@ -229,6 +229,7 @@
<flag name='iscsi.password-secret'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
+ <flag name='hda-output'/>
</qemuCaps>
<job type='none' async='migration out' phase='perform3' flags='0x0'>
<disk dev='vdb' migrating='yes'/>
diff --git a/tests/qemustatusxml2xmldata/migration-out-params-in.xml b/tests/qemustatusxml2xmldata/migration-out-params-in.xml
index 17649796..ae206483 100644
--- a/tests/qemustatusxml2xmldata/migration-out-params-in.xml
+++ b/tests/qemustatusxml2xmldata/migration-out-params-in.xml
@@ -236,6 +236,7 @@
<flag name='iscsi.password-secret'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
+ <flag name='hda-output'/>
</qemuCaps>
<job type='none' async='migration out' phase='perform3' flags='0x802'>
<disk dev='vda' migrating='no'/>
diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxml2xmldata/modern-in.xml
index d63fcf79..5b7e2a34 100644
--- a/tests/qemustatusxml2xmldata/modern-in.xml
+++ b/tests/qemustatusxml2xmldata/modern-in.xml
@@ -232,6 +232,7 @@
<flag name='iscsi.password-secret'/>
<flag name='isa-serial'/>
<flag name='dump-completed'/>
+ <flag name='hda-output'/>
</qemuCaps>
<devices>
<device alias='rng0'/>
diff --git a/tests/qemuxml2argvdata/sound-device.args b/tests/qemuxml2argvdata/sound-device.args
index ee8313bf..f97050a0 100644
--- a/tests/qemuxml2argvdata/sound-device.args
+++ b/tests/qemuxml2argvdata/sound-device.args
@@ -33,10 +33,12 @@ server,nowait \
-device intel-hda,id=sound5,bus=pci.0,addr=0x6 \
-device hda-micro,id=sound5-codec0,bus=sound5.0,cad=0 \
-device hda-duplex,id=sound5-codec1,bus=sound5.0,cad=1 \
+-device hda-output,id=sound5-codec2,bus=sound5.0,cad=2 \
-device ich9-intel-hda,id=sound6,bus=pci.0,addr=0x7 \
-device hda-duplex,id=sound6-codec0,bus=sound6.0,cad=0 \
-device ich9-intel-hda,id=sound7,bus=pci.0,addr=0x8 \
-device hda-micro,id=sound7-codec0,bus=sound7.0,cad=0 \
-device hda-duplex,id=sound7-codec1,bus=sound7.0,cad=1 \
+-device hda-output,id=sound7-codec2,bus=sound7.0,cad=2 \
-device usb-audio,id=sound8,bus=usb.0,port=1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x9
diff --git a/tests/qemuxml2argvdata/sound-device.xml b/tests/qemuxml2argvdata/sound-device.xml
index bceb9d1f..c544e931 100644
--- a/tests/qemuxml2argvdata/sound-device.xml
+++ b/tests/qemuxml2argvdata/sound-device.xml
@@ -32,11 +32,13 @@
<sound model='ich6'>
<codec type='micro'/>
<codec type='duplex'/>
+ <codec type='output'/>
</sound>
<sound model='ich9'/>
<sound model='ich9'>
<codec type='micro'/>
<codec type='duplex'/>
+ <codec type='output'/>
</sound>
<sound model='usb'/>
<memballoon model='virtio'/>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 07e5ba1d..ff32347f 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1515,6 +1515,7 @@ mymain(void)
DO_TEST("sound", NONE);
DO_TEST("sound-device",
QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_HDA_MICRO,
+ QEMU_CAPS_HDA_OUTPUT,
QEMU_CAPS_DEVICE_ICH9_INTEL_HDA,
QEMU_CAPS_OBJECT_USB_AUDIO);
DO_TEST("fs9p", NONE);
diff --git a/tests/qemuxml2xmloutdata/sound-device.xml b/tests/qemuxml2xmloutdata/sound-device.xml
index 62336a8c..cbf4d179 100644
--- a/tests/qemuxml2xmloutdata/sound-device.xml
+++ b/tests/qemuxml2xmloutdata/sound-device.xml
@@ -43,6 +43,7 @@
<sound model='ich6'>
<codec type='micro'/>
<codec type='duplex'/>
+ <codec type='output'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</sound>
<sound model='ich9'>
@@ -51,6 +52,7 @@
<sound model='ich9'>
<codec type='micro'/>
<codec type='duplex'/>
+ <codec type='output'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</sound>
<sound model='usb'/>
--
2.17.0
6 years, 6 months
[libvirt] [PATCH 0/2] qemu: Enable multihead screendumps
by Michal Privoznik
There's one small problem. QEMU might crash:
https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg04113.html
But apart from that, works like charm.
Michal Privoznik (2):
qemu: Introduce QEMU_CAPS_SCREENDUMP_DEVICE
qemu: Implement multiple screen support for virDomainScreenshot
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 38 ++++++++++++++++++----
src/qemu/qemu_monitor.c | 4 ++-
src/qemu/qemu_monitor.h | 2 ++
src/qemu/qemu_monitor_json.c | 4 +++
src/qemu/qemu_monitor_json.h | 2 ++
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
tests/qemumonitorjsontest.c | 2 +-
12 files changed, 50 insertions(+), 9 deletions(-)
--
2.16.1
6 years, 6 months
[libvirt] [PATCH 0/4] qemu: TLS cleanup and fix of path escaping
by Peter Krempa
Clean up some code and fix wrong escaping of TLS certificate path.
Peter Krempa (4):
qemu: command: Optimize formatting of 'passwordid' in
qemuBuildTLSx509BackendProps
tests: qemuxml2argv: Test TLS certificate path containing a comma
qemu: command: Fix formatting of TLS backend properties
qemu: command: Remove qemuBuildHasMasterKey
src/qemu/qemu_command.c | 40 +++-------------------
.../disk-drive-network-tlsx509-vxhs.args | 8 ++---
tests/qemuxml2argvtest.c | 2 +-
3 files changed, 10 insertions(+), 40 deletions(-)
--
2.16.2
6 years, 6 months
[libvirt] [jenkins-ci PATCH] lcitool: Use Perl to generate password hashes
by Andrea Bolognani
We claim to be using Python 2 at the moment: however, we rely
on crypt.mksalt(), which was introduced in Python 3 and has
only been backported to Python 2 in RHEL and Fedora, so the
script will only work on those operating systems.
We could move to Python 3, but the CI nodes are running on a
CentOS 7 machine, where it can't be installed without pulling
in third-party repositories and dealing with awkward naming;
moreover, Ansible itself is still tied to Python 2, so we
would be requiring both to be available.
Perl to the rescue! The script ends up being only marginally
more verbose and obscure as a result, the indentation is
significantly better, and it should finally run on pretty
much any platform.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/lcitool | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/guests/lcitool b/guests/lcitool
index 5b2efb9..568e52c 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -18,11 +18,11 @@ die() {
hash_file() {
PASS_FILE="$1"
- python2 -c "
-import crypt
-password = open('$PASS_FILE', 'r').read().strip()
-print(crypt.crypt(password,
- crypt.mksalt(crypt.METHOD_SHA512)))"
+ perl -le '
+ my @chars = ("A".."Z", "a".."z", "0".."9");
+ my $salt; $salt .= $chars[rand @chars] for 1..16;
+ open(my $handle, "'"$PASS_FILE"'"); my $pass = <$handle>; chomp $pass;
+ print crypt("$pass", "\$6\$$salt\$");'
}
# yaml_var FILE VAR
--
2.17.0
6 years, 6 months
[libvirt] [tck PATCH] Stop deleting MANIFEST file when making release dists
by Daniel P. Berrangé
The MANIFEST file is now pre-created rather than auto-generated
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as trivial + build fix
prepare-release.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/prepare-release.sh b/prepare-release.sh
index ad29f16..ef5d7b8 100755
--- a/prepare-release.sh
+++ b/prepare-release.sh
@@ -16,7 +16,7 @@ NAME=Sys-Virt-TCK
set -e
-rm -rf MANIFEST blib _build Build
+rm -rf blib _build Build
perl Build.PL install_base=$HOME/builder
--
2.17.0
6 years, 6 months
[libvirt] [PATCH 0/9] RISC-V Guest Support
by Lubomir Rintel
Hello,
here's patches I've used in order to be able to run RISC-V guests with
libvirtd. In case you're interested in having RISC-V support you may
want to have a look.
There are some problems I am aware of, though not really able to
address. I might be wrong about some points -- whoever is more familiar
with QEMU, RISC-V or libvirt please correct me:
* Essentially only the "virt" machine is useful, because others don't
seem to support storage or network (as of qemu-2.12). It is not
default though, so creating a reasonable guest configuration is not
intuitive.
* The serial port used by the "virt" machine is NS16550A connected to
the platform bus, but it doesn't seem to appear in the QEMU device
model. I hardcoded it in qemuChrIsPlatformDevice() and
qemuDomainChrDefPostParse() so that we end up defaulting to the
correct one for the virt machine.
* The tests were in a large part cargo-culted. I made some effort
to cover what I thought was important, but it likely needs a better
pair of eyes than mine. More in the idividual patches.
In any case, I am able to boot Fedora and things seem to work well in
general. I'll be thankful for feedback (and even more thankful if anyone
more familiar with libvirtd picks up the patchset :).
Hope this is useful,
Lubo
Diffstat follows.
Lubomir Rintel (9):
conf: add an option to specify a NS16550A serial port
qemu: enable GIC only on AArch64
qemu: rename qemuDomainAssignARMVirtioMMIOAddresses()
util: add RISC-V support
tests/capabilitiestest: add RISC-V capability tests
tests/util: add RISC-V capabilities
tests/captest: check RISC-V capabilities lookup
tests/qemuxml2argvtest: test RISC-V virt machine arguments
tests/virschematest: add RISC-V to capabilityschemadata/caps-qemu-kvm
docs/schemas/basictypes.rng | 2 +
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 17 +-
src/qemu/qemu_domain.c | 24 +-
src/qemu/qemu_domain_address.c | 27 +-
src/util/virarch.c | 3 +
src/util/virarch.h | 6 +
tests/capabilityschemadata/caps-qemu-kvm.xml | 36 +
.../caps_2.12.0.riscv32.replies | 14420 ++++++++++++++++
.../caps_2.12.0.riscv32.xml | 119 +
.../caps_2.12.0.riscv64.replies | 14420 ++++++++++++++++
.../caps_2.12.0.riscv64.xml | 119 +
tests/qemucapabilitiestest.c | 2 +
tests/qemuxml2argvdata/riscv64-virt.args | 29 +
tests/qemuxml2argvdata/riscv64-virt.xml | 34 +
tests/qemuxml2argvtest.c | 2 +
.../riscv64-virt.xml | 37 +
tests/testutilsqemu.c | 72 +
tests/vircapstest.c | 6 +
21 files changed, 29354 insertions(+), 24 deletions(-)
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.riscv32.replies
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.riscv32.xml
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.riscv64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.riscv64.xml
create mode 100644 tests/qemuxml2argvdata/riscv64-virt.args
create mode 100644 tests/qemuxml2argvdata/riscv64-virt.xml
create mode 100644 tests/qemuxml2startupxmloutdata/riscv64-virt.xml
--
2.17.0
6 years, 6 months
[libvirt] [jenkins-ci PATCH] projects: set TEST_MAINTAINER for libvirt-perl build job too
by Daniel P. Berrangé
The TEST_MAINTAINER=1 env variable will effect running of Build.PL,
causing it to turn on many more GCC warning flags to validate the
build. So we need to set it for build job as well as test job.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
projects/libvirt-perl.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/projects/libvirt-perl.yaml b/projects/libvirt-perl.yaml
index 5cbe04c..28288e8 100644
--- a/projects/libvirt-perl.yaml
+++ b/projects/libvirt-perl.yaml
@@ -6,6 +6,8 @@
jobs:
- perl-modulebuild-build-job:
parent_jobs: 'libvirt-master-build'
+ local_env: |
+ export TEST_MAINTAINER=1
- perl-modulebuild-check-job:
parent_jobs: 'libvirt-perl-master-build'
local_env: |
--
2.17.0
6 years, 6 months
[libvirt] [PATCH] docs: Fix copy-paste error in formatdomaincaps
by Martin Kletzander
Reported-instead-of-fixing-immediately-by: Jiri Denemark <jdenemar(a)redhat.com>
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/formatdomaincaps.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in
index 86c9ce8c5c23..b68ae4b4f1f3 100644
--- a/docs/formatdomaincaps.html.in
+++ b/docs/formatdomaincaps.html.in
@@ -208,7 +208,7 @@
</dd>
</dl>
- <h3><a id="elementsIothread">CPU configuration</a></h3>
+ <h3><a id="elementsIothreads">I/O Threads</a></h3>
<p>
The <code>iothread</code> elements indicates whether or not
--
2.17.0
6 years, 6 months
[libvirt] [PATCH REBASE 0/5] qemu: fix domain object wait to handle monitor errors
by Nikolay Shirokovskiy
Main patch is 4th, others are misc.
Nikolay Shirokovskiy (5):
qemu: erase synchronous block job cancel mentions in comments
qemu: monitor: set error flag even in OOM conditions
utils: export virCopyError
qemu: fix domain object wait to handle monitor errors
qemu: fix races in beingDestroyed usage
src/conf/domain_conf.c | 43 ---------------------------------------
src/conf/domain_conf.h | 3 ---
src/libvirt_private.syms | 3 +--
src/qemu/qemu_domain.c | 45 +++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 7 +++++--
src/qemu/qemu_driver.c | 27 +++++++++++++++----------
src/qemu/qemu_hotplug.c | 4 ++--
src/qemu/qemu_migration.c | 12 +++++------
src/qemu/qemu_monitor.c | 5 +++++
src/qemu/qemu_process.c | 51 +++++++++++++++++++++++++++++++----------------
src/util/virerror.c | 12 ++++++++---
src/util/virerror.h | 1 +
12 files changed, 124 insertions(+), 89 deletions(-)
--
1.8.3.1
6 years, 6 months
[libvirt] [PATCHv3 00/13] Switch from yajl to Jansson
by Ján Tomko
Per the discussion here:
https://www.redhat.com/archives/libvir-list/2017-November/msg00225.html
Switch from using yajl to Jansson.
v1:
https://www.redhat.com/archives/libvir-list/2018-March/msg01781.html
v2:
https://www.redhat.com/archives/libvir-list/2018-May/msg00695.html
Patches 3-9 are meant to be squashed together before pushing, but are
posted separately here in hope it will make reviewing them easier.
v3: separated the removal of yajl functions, also removed WITH_YAJL from
config-post.h and split the virt-driver-qemu.m4 changes into two
patches, now with AC_REQUIRE for the CHECK_JANSSON dependency
Ján Tomko (13):
build: add --with-jansson
build: undef WITH_JANSSON for SETUID_RPC_CLIENT
Switch from yajl to Jansson
FIXUP: fix tests
FIXUP: Deprecate building --with-yajl
FIXUP: make nss depend on Jansson instead of yajl
FIXUP: compile and link with Jansson instead of yajl
FIXUP: s/WITH_YAJL/WITH_JANSSON/
FIXUP: libvirt.spec: use jansson instead of yajl
Remove functions using yajl
build: remove references to WITH_YAJL for SETUID_RPC_CLIENT
build: switch --with-qemu default from yes to check
build: require Jansson if QEMU driver is enabled
config-post.h | 3 +-
configure.ac | 3 +
libvirt.spec.in | 4 +-
m4/virt-driver-qemu.m4 | 9 +-
m4/virt-jansson.m4 | 29 ++
m4/virt-nss.m4 | 4 +-
m4/virt-yajl.m4 | 27 +-
src/Makefile.am | 8 +-
src/qemu/qemu_driver.c | 2 +-
src/util/Makefile.inc.am | 4 +-
src/util/virjson.c | 597 ++++++++-----------------------
tests/Makefile.am | 12 +-
tests/cputest.c | 16 +-
tests/libxlxml2domconfigtest.c | 4 +-
tests/qemuagenttest.c | 2 +-
tests/qemublocktest.c | 1 +
tests/qemucapabilitiestest.c | 2 +-
tests/qemucaps2xmltest.c | 2 +-
tests/qemucommandutiltest.c | 2 +-
tests/qemuhotplugtest.c | 2 +-
tests/qemumigparamsdata/empty.json | 4 +-
tests/qemumigparamsdata/unsupported.json | 4 +-
tests/qemumigparamstest.c | 2 +-
tests/qemumonitorjsontest.c | 2 +-
tests/virmacmaptestdata/empty.json | 4 +-
tests/virmocklibxl.c | 4 +-
tests/virnetdaemontest.c | 2 +-
tests/virstoragetest.c | 4 +-
28 files changed, 227 insertions(+), 532 deletions(-)
create mode 100644 m4/virt-jansson.m4
--
2.16.1
6 years, 6 months