ui/console: add vc encoding=utf8/cp437 option

Expose a new "encoding" QemuOpt option.

Add the corresponding QAPI type and properties.

This is going to be wired in the following commits.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2026-04-20 12:11:24 +04:00
parent 4cb2250c58
commit b389b87d3c
6 changed files with 69 additions and 4 deletions

View File

@@ -650,6 +650,13 @@ ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts, Error **errp)
return NULL;
}
}
if (!cc->supports_encoding_opts) {
if (qemu_opt_get(opts, "encoding")) {
error_setg(errp, "chardev '%s' does not support encoding option",
qemu_opts_id(opts));
return NULL;
}
}
backend = g_new0(ChardevBackend, 1);
backend->type = CHARDEV_BACKEND_KIND_NULL;
@@ -972,6 +979,9 @@ QemuOptsList qemu_chardev_opts = {
},{
.name = "rows",
.type = QEMU_OPT_NUMBER,
},{
.name = "encoding",
.type = QEMU_OPT_STRING,
},{
.name = "mux",
.type = QEMU_OPT_BOOL,