console.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. #ifndef CONSOLE_H
  2. #define CONSOLE_H
  3. #include "ui/qemu-pixman.h"
  4. #include "qom/object.h"
  5. #include "qemu/notify.h"
  6. #include "qapi/qapi-types-ui.h"
  7. #ifdef CONFIG_OPENGL
  8. # include <epoxy/gl.h>
  9. # include "ui/shader.h"
  10. #endif
  11. /* keyboard/mouse support */
  12. #define MOUSE_EVENT_LBUTTON 0x01
  13. #define MOUSE_EVENT_RBUTTON 0x02
  14. #define MOUSE_EVENT_MBUTTON 0x04
  15. #define MOUSE_EVENT_WHEELUP 0x08
  16. #define MOUSE_EVENT_WHEELDN 0x10
  17. /* identical to the ps/2 keyboard bits */
  18. #define QEMU_SCROLL_LOCK_LED (1 << 0)
  19. #define QEMU_NUM_LOCK_LED (1 << 1)
  20. #define QEMU_CAPS_LOCK_LED (1 << 2)
  21. /* in ms */
  22. #define GUI_REFRESH_INTERVAL_DEFAULT 30
  23. #define GUI_REFRESH_INTERVAL_IDLE 3000
  24. /* Color number is match to standard vga palette */
  25. enum qemu_color_names {
  26. QEMU_COLOR_BLACK = 0,
  27. QEMU_COLOR_BLUE = 1,
  28. QEMU_COLOR_GREEN = 2,
  29. QEMU_COLOR_CYAN = 3,
  30. QEMU_COLOR_RED = 4,
  31. QEMU_COLOR_MAGENTA = 5,
  32. QEMU_COLOR_YELLOW = 6,
  33. QEMU_COLOR_WHITE = 7
  34. };
  35. /* Convert to curses char attributes */
  36. #define ATTR2CHTYPE(c, fg, bg, bold) \
  37. ((bold) << 21 | (bg) << 11 | (fg) << 8 | (c))
  38. typedef void QEMUPutKBDEvent(void *opaque, int keycode);
  39. typedef void QEMUPutLEDEvent(void *opaque, int ledstate);
  40. typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state);
  41. typedef struct QEMUPutMouseEntry QEMUPutMouseEntry;
  42. typedef struct QEMUPutKbdEntry QEMUPutKbdEntry;
  43. typedef struct QEMUPutLEDEntry QEMUPutLEDEntry;
  44. QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func,
  45. void *opaque);
  46. QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
  47. void *opaque, int absolute,
  48. const char *name);
  49. void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry);
  50. void qemu_activate_mouse_event_handler(QEMUPutMouseEntry *entry);
  51. QEMUPutLEDEntry *qemu_add_led_event_handler(QEMUPutLEDEvent *func, void *opaque);
  52. void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry);
  53. void kbd_put_ledstate(int ledstate);
  54. bool qemu_mouse_set(int index, Error **errp);
  55. /* keysym is a unicode code except for special keys (see QEMU_KEY_xxx
  56. constants) */
  57. #define QEMU_KEY_ESC1(c) ((c) | 0xe100)
  58. #define QEMU_KEY_TAB 0x0009
  59. #define QEMU_KEY_BACKSPACE 0x007f
  60. #define QEMU_KEY_UP QEMU_KEY_ESC1('A')
  61. #define QEMU_KEY_DOWN QEMU_KEY_ESC1('B')
  62. #define QEMU_KEY_RIGHT QEMU_KEY_ESC1('C')
  63. #define QEMU_KEY_LEFT QEMU_KEY_ESC1('D')
  64. #define QEMU_KEY_HOME QEMU_KEY_ESC1(1)
  65. #define QEMU_KEY_END QEMU_KEY_ESC1(4)
  66. #define QEMU_KEY_PAGEUP QEMU_KEY_ESC1(5)
  67. #define QEMU_KEY_PAGEDOWN QEMU_KEY_ESC1(6)
  68. #define QEMU_KEY_DELETE QEMU_KEY_ESC1(3)
  69. #define QEMU_KEY_CTRL_UP 0xe400
  70. #define QEMU_KEY_CTRL_DOWN 0xe401
  71. #define QEMU_KEY_CTRL_LEFT 0xe402
  72. #define QEMU_KEY_CTRL_RIGHT 0xe403
  73. #define QEMU_KEY_CTRL_HOME 0xe404
  74. #define QEMU_KEY_CTRL_END 0xe405
  75. #define QEMU_KEY_CTRL_PAGEUP 0xe406
  76. #define QEMU_KEY_CTRL_PAGEDOWN 0xe407
  77. void kbd_put_keysym_console(QemuConsole *s, int keysym);
  78. bool kbd_put_qcode_console(QemuConsole *s, int qcode, bool ctrl);
  79. void kbd_put_string_console(QemuConsole *s, const char *str, int len);
  80. void kbd_put_keysym(int keysym);
  81. /* consoles */
  82. #define TYPE_QEMU_CONSOLE "qemu-console"
  83. OBJECT_DECLARE_TYPE(QemuConsole, QemuConsoleClass, QEMU_CONSOLE)
  84. struct QemuConsoleClass {
  85. ObjectClass parent_class;
  86. };
  87. #define QEMU_ALLOCATED_FLAG 0x01
  88. #define QEMU_PLACEHOLDER_FLAG 0x02
  89. typedef struct ScanoutTexture {
  90. uint32_t backing_id;
  91. bool backing_y_0_top;
  92. uint32_t backing_width;
  93. uint32_t backing_height;
  94. uint32_t x;
  95. uint32_t y;
  96. uint32_t width;
  97. uint32_t height;
  98. } ScanoutTexture;
  99. typedef struct DisplaySurface {
  100. pixman_format_code_t format;
  101. pixman_image_t *image;
  102. uint8_t flags;
  103. #ifdef CONFIG_OPENGL
  104. GLenum glformat;
  105. GLenum gltype;
  106. GLuint texture;
  107. #endif
  108. } DisplaySurface;
  109. typedef struct QemuUIInfo {
  110. /* physical dimension */
  111. uint16_t width_mm;
  112. uint16_t height_mm;
  113. /* geometry */
  114. int xoff;
  115. int yoff;
  116. uint32_t width;
  117. uint32_t height;
  118. uint32_t refresh_rate;
  119. } QemuUIInfo;
  120. /* cursor data format is 32bit RGBA */
  121. typedef struct QEMUCursor {
  122. int width, height;
  123. int hot_x, hot_y;
  124. int refcount;
  125. uint32_t data[];
  126. } QEMUCursor;
  127. QEMUCursor *cursor_alloc(int width, int height);
  128. void cursor_get(QEMUCursor *c);
  129. void cursor_put(QEMUCursor *c);
  130. QEMUCursor *cursor_builtin_hidden(void);
  131. QEMUCursor *cursor_builtin_left_ptr(void);
  132. void cursor_print_ascii_art(QEMUCursor *c, const char *prefix);
  133. int cursor_get_mono_bpl(QEMUCursor *c);
  134. void cursor_set_mono(QEMUCursor *c,
  135. uint32_t foreground, uint32_t background, uint8_t *image,
  136. int transparent, uint8_t *mask);
  137. void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *mask);
  138. void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask);
  139. typedef void *QEMUGLContext;
  140. typedef struct QEMUGLParams QEMUGLParams;
  141. struct QEMUGLParams {
  142. int major_ver;
  143. int minor_ver;
  144. };
  145. typedef struct QemuDmaBuf {
  146. int fd;
  147. uint32_t width;
  148. uint32_t height;
  149. uint32_t stride;
  150. uint32_t fourcc;
  151. uint64_t modifier;
  152. uint32_t texture;
  153. uint32_t x;
  154. uint32_t y;
  155. uint32_t scanout_width;
  156. uint32_t scanout_height;
  157. bool y0_top;
  158. void *sync;
  159. int fence_fd;
  160. bool allow_fences;
  161. bool draw_submitted;
  162. } QemuDmaBuf;
  163. enum display_scanout {
  164. SCANOUT_NONE,
  165. SCANOUT_SURFACE,
  166. SCANOUT_TEXTURE,
  167. SCANOUT_DMABUF,
  168. };
  169. typedef struct DisplayScanout {
  170. enum display_scanout kind;
  171. union {
  172. /* DisplaySurface *surface; is kept in QemuConsole */
  173. ScanoutTexture texture;
  174. QemuDmaBuf *dmabuf;
  175. };
  176. } DisplayScanout;
  177. typedef struct DisplayState DisplayState;
  178. typedef struct DisplayGLCtx DisplayGLCtx;
  179. typedef struct DisplayChangeListenerOps {
  180. const char *dpy_name;
  181. /* optional */
  182. void (*dpy_refresh)(DisplayChangeListener *dcl);
  183. /* optional */
  184. void (*dpy_gfx_update)(DisplayChangeListener *dcl,
  185. int x, int y, int w, int h);
  186. /* optional */
  187. void (*dpy_gfx_switch)(DisplayChangeListener *dcl,
  188. struct DisplaySurface *new_surface);
  189. /* optional */
  190. bool (*dpy_gfx_check_format)(DisplayChangeListener *dcl,
  191. pixman_format_code_t format);
  192. /* optional */
  193. void (*dpy_text_cursor)(DisplayChangeListener *dcl,
  194. int x, int y);
  195. /* optional */
  196. void (*dpy_text_resize)(DisplayChangeListener *dcl,
  197. int w, int h);
  198. /* optional */
  199. void (*dpy_text_update)(DisplayChangeListener *dcl,
  200. int x, int y, int w, int h);
  201. /* optional */
  202. void (*dpy_mouse_set)(DisplayChangeListener *dcl,
  203. int x, int y, int on);
  204. /* optional */
  205. void (*dpy_cursor_define)(DisplayChangeListener *dcl,
  206. QEMUCursor *cursor);
  207. /* required if GL */
  208. void (*dpy_gl_scanout_disable)(DisplayChangeListener *dcl);
  209. /* required if GL */
  210. void (*dpy_gl_scanout_texture)(DisplayChangeListener *dcl,
  211. uint32_t backing_id,
  212. bool backing_y_0_top,
  213. uint32_t backing_width,
  214. uint32_t backing_height,
  215. uint32_t x, uint32_t y,
  216. uint32_t w, uint32_t h);
  217. /* optional (default to true if has dpy_gl_scanout_dmabuf) */
  218. bool (*dpy_has_dmabuf)(DisplayChangeListener *dcl);
  219. /* optional */
  220. void (*dpy_gl_scanout_dmabuf)(DisplayChangeListener *dcl,
  221. QemuDmaBuf *dmabuf);
  222. /* optional */
  223. void (*dpy_gl_cursor_dmabuf)(DisplayChangeListener *dcl,
  224. QemuDmaBuf *dmabuf, bool have_hot,
  225. uint32_t hot_x, uint32_t hot_y);
  226. /* optional */
  227. void (*dpy_gl_cursor_position)(DisplayChangeListener *dcl,
  228. uint32_t pos_x, uint32_t pos_y);
  229. /* optional */
  230. void (*dpy_gl_release_dmabuf)(DisplayChangeListener *dcl,
  231. QemuDmaBuf *dmabuf);
  232. /* required if GL */
  233. void (*dpy_gl_update)(DisplayChangeListener *dcl,
  234. uint32_t x, uint32_t y, uint32_t w, uint32_t h);
  235. } DisplayChangeListenerOps;
  236. struct DisplayChangeListener {
  237. uint64_t update_interval;
  238. const DisplayChangeListenerOps *ops;
  239. DisplayState *ds;
  240. QemuConsole *con;
  241. QLIST_ENTRY(DisplayChangeListener) next;
  242. };
  243. typedef struct DisplayGLCtxOps {
  244. bool (*dpy_gl_ctx_is_compatible_dcl)(DisplayGLCtx *dgc,
  245. DisplayChangeListener *dcl);
  246. QEMUGLContext (*dpy_gl_ctx_create)(DisplayGLCtx *dgc,
  247. QEMUGLParams *params);
  248. void (*dpy_gl_ctx_destroy)(DisplayGLCtx *dgc,
  249. QEMUGLContext ctx);
  250. int (*dpy_gl_ctx_make_current)(DisplayGLCtx *dgc,
  251. QEMUGLContext ctx);
  252. void (*dpy_gl_ctx_create_texture)(DisplayGLCtx *dgc,
  253. DisplaySurface *surface);
  254. void (*dpy_gl_ctx_destroy_texture)(DisplayGLCtx *dgc,
  255. DisplaySurface *surface);
  256. void (*dpy_gl_ctx_update_texture)(DisplayGLCtx *dgc,
  257. DisplaySurface *surface,
  258. int x, int y, int w, int h);
  259. } DisplayGLCtxOps;
  260. struct DisplayGLCtx {
  261. const DisplayGLCtxOps *ops;
  262. #ifdef CONFIG_OPENGL
  263. QemuGLShader *gls; /* optional shared shader */
  264. #endif
  265. };
  266. DisplayState *init_displaystate(void);
  267. DisplaySurface *qemu_create_displaysurface_from(int width, int height,
  268. pixman_format_code_t format,
  269. int linesize, uint8_t *data);
  270. DisplaySurface *qemu_create_displaysurface_pixman(pixman_image_t *image);
  271. DisplaySurface *qemu_create_placeholder_surface(int w, int h,
  272. const char *msg);
  273. PixelFormat qemu_default_pixelformat(int bpp);
  274. DisplaySurface *qemu_create_displaysurface(int width, int height);
  275. void qemu_free_displaysurface(DisplaySurface *surface);
  276. static inline int is_buffer_shared(DisplaySurface *surface)
  277. {
  278. return !(surface->flags & QEMU_ALLOCATED_FLAG);
  279. }
  280. static inline int is_placeholder(DisplaySurface *surface)
  281. {
  282. return surface->flags & QEMU_PLACEHOLDER_FLAG;
  283. }
  284. void register_displaychangelistener(DisplayChangeListener *dcl);
  285. void update_displaychangelistener(DisplayChangeListener *dcl,
  286. uint64_t interval);
  287. void unregister_displaychangelistener(DisplayChangeListener *dcl);
  288. bool dpy_ui_info_supported(QemuConsole *con);
  289. const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con);
  290. int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info, bool delay);
  291. void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h);
  292. void dpy_gfx_update_full(QemuConsole *con);
  293. void dpy_gfx_replace_surface(QemuConsole *con,
  294. DisplaySurface *surface);
  295. void dpy_text_cursor(QemuConsole *con, int x, int y);
  296. void dpy_text_update(QemuConsole *con, int x, int y, int w, int h);
  297. void dpy_text_resize(QemuConsole *con, int w, int h);
  298. void dpy_mouse_set(QemuConsole *con, int x, int y, int on);
  299. void dpy_cursor_define(QemuConsole *con, QEMUCursor *cursor);
  300. bool dpy_cursor_define_supported(QemuConsole *con);
  301. bool dpy_gfx_check_format(QemuConsole *con,
  302. pixman_format_code_t format);
  303. void dpy_gl_scanout_disable(QemuConsole *con);
  304. void dpy_gl_scanout_texture(QemuConsole *con,
  305. uint32_t backing_id, bool backing_y_0_top,
  306. uint32_t backing_width, uint32_t backing_height,
  307. uint32_t x, uint32_t y, uint32_t w, uint32_t h);
  308. void dpy_gl_scanout_dmabuf(QemuConsole *con,
  309. QemuDmaBuf *dmabuf);
  310. void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf,
  311. bool have_hot, uint32_t hot_x, uint32_t hot_y);
  312. void dpy_gl_cursor_position(QemuConsole *con,
  313. uint32_t pos_x, uint32_t pos_y);
  314. void dpy_gl_release_dmabuf(QemuConsole *con,
  315. QemuDmaBuf *dmabuf);
  316. void dpy_gl_update(QemuConsole *con,
  317. uint32_t x, uint32_t y, uint32_t w, uint32_t h);
  318. QEMUGLContext dpy_gl_ctx_create(QemuConsole *con,
  319. QEMUGLParams *params);
  320. void dpy_gl_ctx_destroy(QemuConsole *con, QEMUGLContext ctx);
  321. int dpy_gl_ctx_make_current(QemuConsole *con, QEMUGLContext ctx);
  322. bool console_has_gl(QemuConsole *con);
  323. static inline int surface_stride(DisplaySurface *s)
  324. {
  325. return pixman_image_get_stride(s->image);
  326. }
  327. static inline void *surface_data(DisplaySurface *s)
  328. {
  329. return pixman_image_get_data(s->image);
  330. }
  331. static inline int surface_width(DisplaySurface *s)
  332. {
  333. return pixman_image_get_width(s->image);
  334. }
  335. static inline int surface_height(DisplaySurface *s)
  336. {
  337. return pixman_image_get_height(s->image);
  338. }
  339. static inline int surface_bits_per_pixel(DisplaySurface *s)
  340. {
  341. int bits = PIXMAN_FORMAT_BPP(s->format);
  342. return bits;
  343. }
  344. static inline int surface_bytes_per_pixel(DisplaySurface *s)
  345. {
  346. int bits = PIXMAN_FORMAT_BPP(s->format);
  347. return DIV_ROUND_UP(bits, 8);
  348. }
  349. static inline pixman_format_code_t surface_format(DisplaySurface *s)
  350. {
  351. return s->format;
  352. }
  353. typedef uint32_t console_ch_t;
  354. static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
  355. {
  356. *dest = ch;
  357. }
  358. enum {
  359. GRAPHIC_FLAGS_NONE = 0,
  360. /* require a console/display with GL callbacks */
  361. GRAPHIC_FLAGS_GL = 1 << 0,
  362. /* require a console/display with DMABUF import */
  363. GRAPHIC_FLAGS_DMABUF = 1 << 1,
  364. };
  365. typedef struct GraphicHwOps {
  366. int (*get_flags)(void *opaque); /* optional, default 0 */
  367. void (*invalidate)(void *opaque);
  368. void (*gfx_update)(void *opaque);
  369. bool gfx_update_async; /* if true, calls graphic_hw_update_done() */
  370. void (*text_update)(void *opaque, console_ch_t *text);
  371. void (*ui_info)(void *opaque, uint32_t head, QemuUIInfo *info);
  372. void (*gl_block)(void *opaque, bool block);
  373. } GraphicHwOps;
  374. QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head,
  375. const GraphicHwOps *ops,
  376. void *opaque);
  377. void graphic_console_set_hwops(QemuConsole *con,
  378. const GraphicHwOps *hw_ops,
  379. void *opaque);
  380. void graphic_console_close(QemuConsole *con);
  381. void graphic_hw_update(QemuConsole *con);
  382. void graphic_hw_update_done(QemuConsole *con);
  383. void graphic_hw_invalidate(QemuConsole *con);
  384. void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata);
  385. void graphic_hw_gl_block(QemuConsole *con, bool block);
  386. void qemu_console_early_init(void);
  387. void qemu_console_set_display_gl_ctx(QemuConsole *con, DisplayGLCtx *ctx);
  388. QemuConsole *qemu_console_lookup_by_index(unsigned int index);
  389. QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head);
  390. QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,
  391. uint32_t head, Error **errp);
  392. QemuConsole *qemu_console_lookup_unused(void);
  393. bool qemu_console_is_visible(QemuConsole *con);
  394. bool qemu_console_is_graphic(QemuConsole *con);
  395. bool qemu_console_is_fixedsize(QemuConsole *con);
  396. bool qemu_console_is_gl_blocked(QemuConsole *con);
  397. bool qemu_console_is_multihead(DeviceState *dev);
  398. char *qemu_console_get_label(QemuConsole *con);
  399. int qemu_console_get_index(QemuConsole *con);
  400. uint32_t qemu_console_get_head(QemuConsole *con);
  401. int qemu_console_get_width(QemuConsole *con, int fallback);
  402. int qemu_console_get_height(QemuConsole *con, int fallback);
  403. /* Return the low-level window id for the console */
  404. int qemu_console_get_window_id(QemuConsole *con);
  405. /* Set the low-level window id for the console */
  406. void qemu_console_set_window_id(QemuConsole *con, int window_id);
  407. void console_select(unsigned int index);
  408. void qemu_console_resize(QemuConsole *con, int width, int height);
  409. DisplaySurface *qemu_console_surface(QemuConsole *con);
  410. /* console-gl.c */
  411. #ifdef CONFIG_OPENGL
  412. bool console_gl_check_format(DisplayChangeListener *dcl,
  413. pixman_format_code_t format);
  414. void surface_gl_create_texture(QemuGLShader *gls,
  415. DisplaySurface *surface);
  416. void surface_gl_update_texture(QemuGLShader *gls,
  417. DisplaySurface *surface,
  418. int x, int y, int w, int h);
  419. void surface_gl_render_texture(QemuGLShader *gls,
  420. DisplaySurface *surface);
  421. void surface_gl_destroy_texture(QemuGLShader *gls,
  422. DisplaySurface *surface);
  423. void surface_gl_setup_viewport(QemuGLShader *gls,
  424. DisplaySurface *surface,
  425. int ww, int wh);
  426. #endif
  427. typedef struct QemuDisplay QemuDisplay;
  428. struct QemuDisplay {
  429. DisplayType type;
  430. void (*early_init)(DisplayOptions *opts);
  431. void (*init)(DisplayState *ds, DisplayOptions *opts);
  432. };
  433. void qemu_display_register(QemuDisplay *ui);
  434. bool qemu_display_find_default(DisplayOptions *opts);
  435. void qemu_display_early_init(DisplayOptions *opts);
  436. void qemu_display_init(DisplayState *ds, DisplayOptions *opts);
  437. void qemu_display_help(void);
  438. /* vnc.c */
  439. void vnc_display_init(const char *id, Error **errp);
  440. void vnc_display_open(const char *id, Error **errp);
  441. void vnc_display_add_client(const char *id, int csock, bool skipauth);
  442. int vnc_display_password(const char *id, const char *password);
  443. int vnc_display_pw_expire(const char *id, time_t expires);
  444. void vnc_parse(const char *str);
  445. int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp);
  446. bool vnc_display_reload_certs(const char *id, Error **errp);
  447. bool vnc_display_update(DisplayUpdateOptionsVNC *arg, Error **errp);
  448. /* input.c */
  449. int index_from_key(const char *key, size_t key_length);
  450. #ifdef CONFIG_LINUX
  451. /* udmabuf.c */
  452. int udmabuf_fd(void);
  453. #endif
  454. /* util.c */
  455. bool qemu_console_fill_device_address(QemuConsole *con,
  456. char *device_address,
  457. size_t size,
  458. Error **errp);
  459. #endif