mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
ui/console: specialize console_lookup_unused()
graphics_console_init() is expected to return a graphic console. The function doesn't need to be exported. We are going to specialize further QemuGraphicConsole & QemuTextConsole. The two will not be interchangeable anymore. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230830093843.3531473-24-marcandre.lureau@redhat.com>
This commit is contained in:
parent
34b7751574
commit
f9411aaebd
2 changed files with 4 additions and 4 deletions
|
@ -484,7 +484,6 @@ QemuConsole *qemu_console_lookup_by_index(unsigned int index);
|
||||||
QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head);
|
QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head);
|
||||||
QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,
|
QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,
|
||||||
uint32_t head, Error **errp);
|
uint32_t head, Error **errp);
|
||||||
QemuConsole *qemu_console_lookup_unused(void);
|
|
||||||
QEMUCursor *qemu_console_get_cursor(QemuConsole *con);
|
QEMUCursor *qemu_console_get_cursor(QemuConsole *con);
|
||||||
bool qemu_console_is_visible(QemuConsole *con);
|
bool qemu_console_is_visible(QemuConsole *con);
|
||||||
bool qemu_console_is_graphic(QemuConsole *con);
|
bool qemu_console_is_graphic(QemuConsole *con);
|
||||||
|
|
|
@ -196,6 +196,7 @@ static void text_console_update_cursor(void *opaque);
|
||||||
static bool displaychangelistener_has_dmabuf(DisplayChangeListener *dcl);
|
static bool displaychangelistener_has_dmabuf(DisplayChangeListener *dcl);
|
||||||
static bool console_compatible_with(QemuConsole *con,
|
static bool console_compatible_with(QemuConsole *con,
|
||||||
DisplayChangeListener *dcl, Error **errp);
|
DisplayChangeListener *dcl, Error **errp);
|
||||||
|
static QemuConsole *qemu_graphic_console_lookup_unused(void);
|
||||||
|
|
||||||
static void gui_update(void *opaque)
|
static void gui_update(void *opaque)
|
||||||
{
|
{
|
||||||
|
@ -2184,7 +2185,7 @@ QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head,
|
||||||
QemuConsole *s;
|
QemuConsole *s;
|
||||||
DisplaySurface *surface;
|
DisplaySurface *surface;
|
||||||
|
|
||||||
s = qemu_console_lookup_unused();
|
s = qemu_graphic_console_lookup_unused();
|
||||||
if (s) {
|
if (s) {
|
||||||
trace_console_gfx_reuse(s->index);
|
trace_console_gfx_reuse(s->index);
|
||||||
width = qemu_console_get_width(s, 0);
|
width = qemu_console_get_width(s, 0);
|
||||||
|
@ -2289,13 +2290,13 @@ QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,
|
||||||
return con;
|
return con;
|
||||||
}
|
}
|
||||||
|
|
||||||
QemuConsole *qemu_console_lookup_unused(void)
|
static QemuConsole *qemu_graphic_console_lookup_unused(void)
|
||||||
{
|
{
|
||||||
QemuConsole *con;
|
QemuConsole *con;
|
||||||
Object *obj;
|
Object *obj;
|
||||||
|
|
||||||
QTAILQ_FOREACH(con, &consoles, next) {
|
QTAILQ_FOREACH(con, &consoles, next) {
|
||||||
if (con->hw_ops != &unused_ops) {
|
if (!QEMU_IS_GRAPHIC_CONSOLE(con) || con->hw_ops != &unused_ops) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
obj = object_property_get_link(OBJECT(con),
|
obj = object_property_get_link(OBJECT(con),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue