mirror of https://gitee.com/openkylin/qemu.git
console: allow con==NULL in dpy_{get, set}_ui_info and dpy_ui_info_supported
Use active_console in that case like we do in many other places. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20201208115737.18581-3-kraxel@redhat.com
This commit is contained in:
parent
c7b22c0a7c
commit
5c4b107f88
12
ui/console.c
12
ui/console.c
|
@ -1544,19 +1544,27 @@ static void dpy_set_ui_info_timer(void *opaque)
|
|||
|
||||
bool dpy_ui_info_supported(QemuConsole *con)
|
||||
{
|
||||
if (con == NULL) {
|
||||
con = active_console;
|
||||
}
|
||||
|
||||
return con->hw_ops->ui_info != NULL;
|
||||
}
|
||||
|
||||
const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con)
|
||||
{
|
||||
assert(con != NULL);
|
||||
if (con == NULL) {
|
||||
con = active_console;
|
||||
}
|
||||
|
||||
return &con->ui_info;
|
||||
}
|
||||
|
||||
int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info)
|
||||
{
|
||||
assert(con != NULL);
|
||||
if (con == NULL) {
|
||||
con = active_console;
|
||||
}
|
||||
|
||||
if (!dpy_ui_info_supported(con)) {
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue