[libvirt] [PATCH v3 7/9] qemu: move validation of video accel to qemu_domain.c

Jonathon Jongsma jjongsma at redhat.com
Fri Oct 18 15:30:15 UTC 2019


Continue consolidation of video device validation started in previous
patch.

Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
---
 src/qemu/qemu_domain.c  |  9 +++++++++
 src/qemu/qemu_process.c | 11 -----------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 0a6d774437..8bd5891e53 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5792,6 +5792,15 @@ qemuDomainDeviceDefValidateVideo(const virDomainVideoDef *video,
                            _("this QEMU does not support 'vhost-user' video device"));
             return -1;
         }
+    } else if (video->accel) {
+        if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON &&
+            (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO ||
+             !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL))) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("%s 3d acceleration is not supported"),
+                           virDomainVideoTypeToString(video->type));
+            return -1;
+        }
     }
 
     return 0;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 25465f05e2..5ef3e37fc2 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5274,17 +5274,6 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm,
                                virDomainVideoTypeToString(video->type));
                 return -1;
             }
-
-            if (video->accel) {
-                if (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON &&
-                    (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO ||
-                     !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL))) {
-                    virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                                   _("%s 3d acceleration is not supported"),
-                                   virDomainVideoTypeToString(video->type));
-                    return -1;
-                }
-            }
         }
     }
 
-- 
2.21.0




More information about the libvir-list mailing list