From: Kristina Hanicova Date: Wed, 10 Mar 2021 16:42:51 +0000 (+0100) Subject: domain_validate: XML validate that non-virtio video devices have none virtio options X-Git-Tag: v7.2.0-rc1~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25d3b41e5e9c46601c5aabdc792650345516e6dd;p=thirdparty%2Flibvirt.git domain_validate: XML validate that non-virtio video devices have none virtio options With this, XML fails if non-virtio video devices have virtio options. Previously it didn't raise error. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1922093 Signed-off-by: Kristina Hanicova Reviewed-by: Michal Privoznik --- diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index fc97fdffb9..a455c30737 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -187,6 +187,10 @@ virDomainVideoDefValidate(const virDomainVideoDef *video, } } + if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + (virDomainCheckVirtioOptionsAreAbsent(video->virtio) < 0)) + return -1; + return 0; }