qemu: move validation of video accel to qemu_domain.c

Continue consolidation of video device validation started in previous
patch.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Jonathon Jongsma 2019-10-18 10:30:15 -05:00 committed by Cole Robinson
parent 425310d1c8
commit 42cc3eb912
2 changed files with 9 additions and 11 deletions

View File

@ -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;

View File

@ -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;
}
}
}
}