[libvirt] [PATCH v2 1/5] qemu: whitelist valid video types

Cole Robinson crobinso at redhat.com
Sun Aug 27 15:04:38 UTC 2017


Rather than require an explicit blacklist that needs to be extended
for every new VIDEO_TYPE

Signed-off-by: Cole Robinson <crobinso at redhat.com>
---
 src/qemu/qemu_domain.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2c77a6442..1c6b1ba79 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3014,20 +3014,17 @@ qemuDomainDefValidateVideo(const virDomainDef *def)
         video = def->videos[i];
 
         switch (video->type) {
-        case VIR_DOMAIN_VIDEO_TYPE_XEN:
-        case VIR_DOMAIN_VIDEO_TYPE_VBOX:
-        case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("video type '%s' is not supported with QEMU"),
-                           virDomainVideoTypeToString(video->type));
-            return -1;
         case VIR_DOMAIN_VIDEO_TYPE_VGA:
         case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
         case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
         case VIR_DOMAIN_VIDEO_TYPE_QXL:
         case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
-        case VIR_DOMAIN_VIDEO_TYPE_LAST:
             break;
+        default:
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("video type '%s' is not supported with QEMU"),
+                           virDomainVideoTypeToString(video->type));
+            return -1;
         }
 
         if (!video->primary &&
-- 
2.13.5




More information about the libvir-list mailing list