]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_validate: XML validate that non-virtio video devices have none virtio options
authorKristina Hanicova <khanicov@redhat.com>
Wed, 10 Mar 2021 16:42:51 +0000 (17:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Mar 2021 14:03:49 +0000 (15:03 +0100)
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 <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_validate.c

index fc97fdffb935936550858abe179d60d4fa1ebcb3..a455c307377dffce993ce69d4a0630203993ff0c 100644 (file)
@@ -187,6 +187,10 @@ virDomainVideoDefValidate(const virDomainVideoDef *video,
         }
     }
 
+    if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
+        (virDomainCheckVirtioOptionsAreAbsent(video->virtio) < 0))
+        return -1;
+
     return 0;
 }