ui/console: fix default VC when there are no display

When display is "none", we may still have remote displays (I think it
would be simpler if VNC/Spice were regular display btw). Return the
default VC then, and set them up to fix a regression when using remote
display and it used the TTY instead.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1989
Fixes: commit 1bec1cc0d ("ui/console: allow to override the default VC")
Reported-by: German Maglione <gmaglione@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
master
Marc-André Lureau 2023-11-08 17:25:22 +04:00
parent b7f1bb38b0
commit 0e8823072e
1 changed files with 8 additions and 10 deletions

View File

@ -1679,19 +1679,17 @@ void qemu_display_init(DisplayState *ds, DisplayOptions *opts)
const char *qemu_display_get_vc(DisplayOptions *opts)
{
assert(opts->type < DISPLAY_TYPE__MAX);
if (opts->type == DISPLAY_TYPE_NONE) {
return NULL;
}
assert(dpys[opts->type] != NULL);
if (dpys[opts->type]->vc) {
return dpys[opts->type]->vc;
} else {
#ifdef CONFIG_PIXMAN
return "vc:80Cx24C";
const char *vc = "vc:80Cx24C";
#else
const char *vc = NULL;
#endif
assert(opts->type < DISPLAY_TYPE__MAX);
if (dpys[opts->type] && dpys[opts->type]->vc) {
vc = dpys[opts->type]->vc;
}
return NULL;
return vc;
}
void qemu_display_help(void)