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

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

 



Continue consolidation of video device validation started in previous
patch.

Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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