Revision 95be0669
b/hw/display/xenfb.c | ||
---|---|---|
987 | 987 |
|
988 | 988 |
/* vfb */ |
989 | 989 |
fb = container_of(xfb, struct XenFB, c.xendev); |
990 |
fb->c.con = graphic_console_init(&xenfb_ops, fb); |
|
990 |
fb->c.con = graphic_console_init(NULL, &xenfb_ops, fb);
|
|
991 | 991 |
fb->have_console = 1; |
992 | 992 |
|
993 | 993 |
/* vkbd */ |
b/include/ui/console.h | ||
---|---|---|
2 | 2 |
#define CONSOLE_H |
3 | 3 |
|
4 | 4 |
#include "ui/qemu-pixman.h" |
5 |
#include "qom/object.h" |
|
5 | 6 |
#include "qapi/qmp/qdict.h" |
6 | 7 |
#include "qemu/notify.h" |
7 | 8 |
#include "monitor/monitor.h" |
... | ... | |
93 | 94 |
|
94 | 95 |
/* consoles */ |
95 | 96 |
|
97 |
#define TYPE_QEMU_CONSOLE "qemu-console" |
|
98 |
#define QEMU_CONSOLE(obj) \ |
|
99 |
OBJECT_CHECK(QemuConsole, (obj), TYPE_QEMU_CONSOLE) |
|
100 |
#define QEMU_CONSOLE_GET_CLASS(obj) \ |
|
101 |
OBJECT_GET_CLASS(QemuConsoleClass, (obj), TYPE_QEMU_CONSOLE) |
|
102 |
#define QEMU_CONSOLE_CLASS(klass) \ |
|
103 |
OBJECT_CLASS_CHECK(QemuConsoleClass, (klass), TYPE_QEMU_CONSOLE) |
|
104 |
|
|
105 |
typedef struct QemuConsoleClass QemuConsoleClass; |
|
106 |
|
|
107 |
struct QemuConsoleClass { |
|
108 |
ObjectClass parent_class; |
|
109 |
}; |
|
110 |
|
|
96 | 111 |
#define QEMU_BIG_ENDIAN_FLAG 0x01 |
97 | 112 |
#define QEMU_ALLOCATED_FLAG 0x02 |
98 | 113 |
|
b/ui/console.c | ||
---|---|---|
113 | 113 |
} console_type_t; |
114 | 114 |
|
115 | 115 |
struct QemuConsole { |
116 |
Object parent; |
|
117 |
|
|
116 | 118 |
int index; |
117 | 119 |
console_type_t console_type; |
118 | 120 |
DisplayState *ds; |
... | ... | |
1197 | 1199 |
|
1198 | 1200 |
static QemuConsole *new_console(DisplayState *ds, console_type_t console_type) |
1199 | 1201 |
{ |
1202 |
Object *obj; |
|
1200 | 1203 |
QemuConsole *s; |
1201 | 1204 |
int i; |
1202 | 1205 |
|
1203 | 1206 |
if (nb_consoles >= MAX_CONSOLES) |
1204 | 1207 |
return NULL; |
1205 |
s = g_malloc0(sizeof(QemuConsole)); |
|
1208 |
obj = object_new(TYPE_QEMU_CONSOLE); |
|
1209 |
s = QEMU_CONSOLE(obj); |
|
1206 | 1210 |
if (!active_console || ((active_console->console_type != GRAPHIC_CONSOLE) && |
1207 | 1211 |
(console_type == GRAPHIC_CONSOLE))) { |
1208 | 1212 |
active_console = s; |
... | ... | |
1920 | 1924 |
} |
1921 | 1925 |
} |
1922 | 1926 |
|
1927 |
static const TypeInfo qemu_console_info = { |
|
1928 |
.name = TYPE_QEMU_CONSOLE, |
|
1929 |
.parent = TYPE_OBJECT, |
|
1930 |
.instance_size = sizeof(QemuConsole), |
|
1931 |
.class_size = sizeof(QemuConsoleClass), |
|
1932 |
}; |
|
1933 |
|
|
1934 |
|
|
1923 | 1935 |
static void register_types(void) |
1924 | 1936 |
{ |
1937 |
type_register_static(&qemu_console_info); |
|
1925 | 1938 |
register_char_driver_qapi("vc", CHARDEV_BACKEND_KIND_VC, |
1926 | 1939 |
qemu_chr_parse_vc); |
1927 | 1940 |
} |
Also available in: Unified diff