From 126e6f381a5429b27aac008c4873f101116da95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 23 Aug 2017 16:32:28 +0200 Subject: [PATCH] conf: check address type for USB hostdevs https://bugzilla.redhat.com/show_bug.cgi?id=1225339 --- src/conf/domain_conf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 33470ffcb0..478feb92d8 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5287,6 +5287,13 @@ virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev) } break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: + if (hostdev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + hostdev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("USB host device must use 'usb' address type")); + return -1; + } + break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: break; -- GitLab