提交 6fe9025e 编写于 作者: C Cole Robinson

qemu: Error on unsupported graphics config

Throw an explicit error if multiple graphics devices are specified, or
an unsupported type is specified (rdp).
上级 d1018b1b
...@@ -4542,6 +4542,12 @@ int qemudBuildCommandLine(virConnectPtr conn, ...@@ -4542,6 +4542,12 @@ int qemudBuildCommandLine(virConnectPtr conn,
} }
} }
if (def->ngraphics > 1) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("only 1 graphics device is supported"));
goto error;
}
if ((def->ngraphics == 1) && if ((def->ngraphics == 1) &&
def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) { def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
virBuffer opt = VIR_BUFFER_INITIALIZER; virBuffer opt = VIR_BUFFER_INITIALIZER;
...@@ -4641,6 +4647,12 @@ int qemudBuildCommandLine(virConnectPtr conn, ...@@ -4641,6 +4647,12 @@ int qemudBuildCommandLine(virConnectPtr conn,
* default, since the default changes :-( */ * default, since the default changes :-( */
if (qemuCmdFlags & QEMUD_CMD_FLAG_SDL) if (qemuCmdFlags & QEMUD_CMD_FLAG_SDL)
ADD_ARG_LIT("-sdl"); ADD_ARG_LIT("-sdl");
} else if ((def->ngraphics == 1)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported graphics type '%s'"),
virDomainGraphicsTypeToString(def->graphics[0]->type));
goto error;
} }
if (def->nvideos) { if (def->nvideos) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册