From 42cc3eb9125ff1d1c24c2d69d84db8086ebedf02 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Fri, 18 Oct 2019 10:30:15 -0500 Subject: [PATCH] qemu: move validation of video accel to qemu_domain.c Continue consolidation of video device validation started in previous patch. Reviewed-by: Cole Robinson Signed-off-by: Jonathon Jongsma --- 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 6d9bf688ce..6b9bd96ec9 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5806,6 +5806,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 9e175d17c9..72e9965109 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5242,17 +5242,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; - } - } } }