[libvirt] [PATCH] conf: Don't parse edev of non-passthrough input device

Han Han hhan at redhat.com
Wed Jul 11 05:57:06 UTC 2018


In input devices, edev attribute is only for passthrough devices.
Don't parse this for other input devices.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1591151

Signed-off-by: Han Han <hhan at 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 7396616eda..ea2e796b78 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13050,7 +13050,8 @@ virDomainInputDefParseXML(virDomainXMLOptionPtr xmlopt,
         goto error;
     }
 
-    if ((evdev = virXPathString("string(./source/@evdev)", ctxt)))
+    if ((evdev = virXPathString("string(./source/@evdev)", ctxt)) &&
+        (def->type == VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH))
         def->source.evdev = virFileSanitizePath(evdev);
     if (def->type == VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH && !def->source.evdev) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
-- 
2.17.1




More information about the libvir-list mailing list