mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +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
|
||||
qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED,
|
||||
virCommandPtr cmd,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
virDomainGraphicsDefPtr graphics)
|
||||
{
|
||||
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
|
||||
@ -7746,13 +7745,6 @@ qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED
|
||||
virBufferAddLit(&opt, "egl-headless");
|
||||
|
||||
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=");
|
||||
virQEMUBuildBufferEscapeComma(&opt,
|
||||
graphics->data.egl_headless.rendernode);
|
||||
@ -7797,7 +7789,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
|
||||
break;
|
||||
case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
|
||||
if (qemuBuildGraphicsEGLHeadlessCommandLine(cfg, cmd,
|
||||
qemuCaps, graphics) < 0)
|
||||
graphics) < 0)
|
||||
return -1;
|
||||
|
||||
break;
|
||||
|
@ -7941,6 +7941,14 @@ qemuDomainDeviceDefValidateGraphics(const virDomainGraphicsDef *graphics,
|
||||
break;
|
||||
|
||||
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;
|
||||
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
|
||||
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
|
||||
|
Loading…
Reference in New Issue
Block a user