From 33bc3ffe545cb04b7f48cc3354c37d7ac5cc3ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 25 Feb 2020 15:44:23 +0100 Subject: [PATCH] conf: only allow virtio bus for input passthrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Other buses are not supported. Signed-off-by: Ján Tomko https://bugzilla.redhat.com/show_bug.cgi?id=1724928 Reviewed-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index bfb95dd2ce..fd0578504c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6620,6 +6620,12 @@ virDomainInputDefValidate(const virDomainInputDef *input) break; case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: + if (input->bus != VIR_DOMAIN_INPUT_BUS_VIRTIO) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("only bus 'virtio' is supported for 'passthrough' " + "input devices")); + return -1; + } break; case VIR_DOMAIN_INPUT_TYPE_LAST: -- GitLab