[PATCH v2 2/2] XML validate that non-virtio video devices have none virtio options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/conf/domain_validate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index dabdd7b8eb..b53f6437cc 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -179,6 +179,10 @@ virDomainVideoDefValidate(const virDomainVideoDef *video,
         }
     }
 
+    if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO &&
+        (virDomainCheckVirtioOptionsAreAbsent(video->virtio) < 0))
+        return -1;
+
     return 0;
 }
 
-- 
2.29.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux