mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu: command: move qemuBuildGraphicsEGLHeadlessCommandLine validation to qemu_domain.c
Move EGL Headless validation from qemuBuildGraphicsEGLHeadlessCommandLine() to qemuDomainDeviceDefValidateGraphics(). This function is called by qemuDomainDefValidate(), validating the graphics parameters in domain define time. Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
2acbbd821b
commit
379e955eb8
@ -7738,7 +7738,6 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
|
|||||||
static int
|
static int
|
||||||
qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED,
|
qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED,
|
||||||
virCommandPtr cmd,
|
virCommandPtr cmd,
|
||||||
virQEMUCapsPtr qemuCaps,
|
|
||||||
virDomainGraphicsDefPtr graphics)
|
virDomainGraphicsDefPtr graphics)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||||
@ -7746,13 +7745,6 @@ qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED
|
|||||||
virBufferAddLit(&opt, "egl-headless");
|
virBufferAddLit(&opt, "egl-headless");
|
||||||
|
|
||||||
if (graphics->data.egl_headless.rendernode) {
|
if (graphics->data.egl_headless.rendernode) {
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS_RENDERNODE)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("This QEMU doesn't support OpenGL rendernode "
|
|
||||||
"with egl-headless graphics type"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
virBufferAddLit(&opt, ",rendernode=");
|
virBufferAddLit(&opt, ",rendernode=");
|
||||||
virQEMUBuildBufferEscapeComma(&opt,
|
virQEMUBuildBufferEscapeComma(&opt,
|
||||||
graphics->data.egl_headless.rendernode);
|
graphics->data.egl_headless.rendernode);
|
||||||
@ -7797,7 +7789,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
|
|||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
|
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
|
||||||
if (qemuBuildGraphicsEGLHeadlessCommandLine(cfg, cmd,
|
if (qemuBuildGraphicsEGLHeadlessCommandLine(cfg, cmd,
|
||||||
qemuCaps, graphics) < 0)
|
graphics) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -7941,6 +7941,14 @@ qemuDomainDeviceDefValidateGraphics(const virDomainGraphicsDef *graphics,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
|
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
|
||||||
|
if (graphics->data.egl_headless.rendernode &&
|
||||||
|
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS_RENDERNODE)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("This QEMU doesn't support OpenGL rendernode "
|
||||||
|
"with egl-headless graphics type"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
|
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
|
||||||
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
|
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
|
||||||
|
Loading…
Reference in New Issue
Block a user