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

Ján Tomko jtomko at redhat.com
Tue Feb 25 16:30:00 UTC 2020


Other buses are not supported.

Signed-off-by: Ján Tomko <jtomko at 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




More information about the libvir-list mailing list