[libvirt PATCH 0/2] conf: only allow virtio bus for input passthrough

https://bugzilla.redhat.com/show_bug.cgi?id=1724928 Ján Tomko (2): conf: only allow virtio bus for input passthrough conf: default to virtio bus for input passthrough src/conf/domain_conf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.24.1

Other buses are not supported. Signed-off-by: Ján Tomko <jtomko@redhat.com> https://bugzilla.redhat.com/show_bug.cgi?id=1724928 --- 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 17867eeece..e7d370e9c6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6610,6 +6610,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: -- 2.24.1

Other buses are not supported. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e7d370e9c6..ef5809ee54 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13610,7 +13610,8 @@ virDomainInputDefParseXML(virDomainXMLOptionPtr xmlopt, def->type == VIR_DOMAIN_INPUT_TYPE_KBD) && (ARCH_IS_X86(dom->os.arch) || dom->os.arch == VIR_ARCH_NONE)) { def->bus = VIR_DOMAIN_INPUT_BUS_PS2; - } else if (ARCH_IS_S390(dom->os.arch)) { + } else if (ARCH_IS_S390(dom->os.arch) || + def->type == VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH) { def->bus = VIR_DOMAIN_INPUT_BUS_VIRTIO; } else { def->bus = VIR_DOMAIN_INPUT_BUS_USB; -- 2.24.1

On 2/25/20 1:29 PM, Ján Tomko wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1724928
Ján Tomko (2): conf: only allow virtio bus for input passthrough conf: default to virtio bus for input passthrough
src/conf/domain_conf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
participants (2)
-
Daniel Henrique Barboza
-
Ján Tomko