Skip to contentSkip to conversation

console: move chardev declarations to sysemu/char.h

PATCH In review Michael S. Tsirkin 3 participants 3 messages Jun 23, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 console: move chardev declarations to sysemu/char.h

move generic chardev APIs to sysemu/char.h, to make them available to callers which can not depend on the whole of ui/console.h. This fixes a build error on systems without pixman-devel:

./configure --disable-tools --disable-docs --target-list=arm-linux-user
...
pixman none
...
make
...
In file included from /data/home/nchip/linaro/qemu/include/ui/console.h:4:0,
from /data/home/nchip/linaro/qemu/stubs/vc-init.c:2:
/data/home/nchip/linaro/qemu/include/ui/qemu-pixman.h:14:20: fatal
error: pixman.h: No such file or directory

 #include <pixman.h>
                    ^

compilation terminated.

---
 include/sysemu/char.h | 5 +++++
 include/ui/console.h  | 5 -----
 qemu-char.c           | 1 -
 stubs/vc-init.c       | 2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)
include/sysemu/char.h +5 -0
index 3b835f6..672ed39 100644
@@ -350,4 +350,9 @@ CharDriverState *qemu_chr_open_msmouse(void);
 /* baum.c */
 CharDriverState *chr_baum_init(void);
 
+/* console.c */
+typedef CharDriverState *(VcHandler)(ChardevVC *vc);
+
+void register_vc_handler(VcHandler *handler);
+CharDriverState *vc_init(ChardevVC *vc);
 #endif
include/ui/console.h +0 -5
index edbaa9b..845526e 100644
@@ -310,11 +310,6 @@ void qemu_console_copy(QemuConsole *con, int src_x, int src_y,
 DisplaySurface *qemu_console_surface(QemuConsole *con);
 DisplayState *qemu_console_displaystate(QemuConsole *console);
 
-typedef CharDriverState *(VcHandler)(ChardevVC *vc);
-
-CharDriverState *vc_init(ChardevVC *vc);
-void register_vc_handler(VcHandler *handler);
-
 /* sdl.c */
 void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
 
qemu-char.c +0 -1
index a52613d..e6cbafb 100644
@@ -23,7 +23,6 @@
  */
 #include "qemu-common.h"
 #include "monitor/monitor.h"
-#include "ui/console.h"
 #include "sysemu/sysemu.h"
 #include "qemu/timer.h"
 #include "sysemu/char.h"
stubs/vc-init.c +1 -1
index 2af054f..308dfa0 100644
@@ -1,5 +1,5 @@
 #include "qemu-common.h"
-#include "ui/console.h"
+#include "sysemu/char.h"
 
 CharDriverState *vc_init(ChardevVC *vc)
 {
Signature · 1 line
MST
Tested-by on v1 1/1
#1 lore raw
Quoted 15 lines · Michael S. Tsirkin

move generic chardev APIs to sysemu/char.h, to make them available to callers which can not depend on the whole of ui/console.h. This fixes a build error on systems without pixman-devel:

./configure --disable-tools --disable-docs --target-list=arm-linux-user
...
pixman none
...
make
...
In file included from /data/home/nchip/linaro/qemu/include/ui/console.h:4:0,
from /data/home/nchip/linaro/qemu/stubs/vc-init.c:2:
/data/home/nchip/linaro/qemu/include/ui/qemu-pixman.h:14:20: fatal
error: pixman.h: No such file or directory

Quoted 3 lines
 #include <pixman.h>
                    ^

compilation terminated.

This fix works for me, thanks.

Quoted 64 lines
---
 include/sysemu/char.h | 5 +++++
 include/ui/console.h  | 5 -----
 qemu-char.c           | 1 -
 stubs/vc-init.c       | 2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)
include/sysemu/char.h +5 -0
index 3b835f6..672ed39 100644
@@ -350,4 +350,9 @@ CharDriverState *qemu_chr_open_msmouse(void);
 /* baum.c */
 CharDriverState *chr_baum_init(void);
 
+/* console.c */
+typedef CharDriverState *(VcHandler)(ChardevVC *vc);
+
+void register_vc_handler(VcHandler *handler);
+CharDriverState *vc_init(ChardevVC *vc);
 #endif
include/ui/console.h +0 -5
index edbaa9b..845526e 100644
@@ -310,11 +310,6 @@ void qemu_console_copy(QemuConsole *con, int src_x, int src_y,
 DisplaySurface *qemu_console_surface(QemuConsole *con);
 DisplayState *qemu_console_displaystate(QemuConsole *console);
 
-typedef CharDriverState *(VcHandler)(ChardevVC *vc);
-
-CharDriverState *vc_init(ChardevVC *vc);
-void register_vc_handler(VcHandler *handler);
-
 /* sdl.c */
 void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
 
qemu-char.c +0 -1
index a52613d..e6cbafb 100644
@@ -23,7 +23,6 @@
  */
 #include "qemu-common.h"
 #include "monitor/monitor.h"
-#include "ui/console.h"
 #include "sysemu/sysemu.h"
 #include "qemu/timer.h"
 #include "sysemu/char.h"
stubs/vc-init.c +1 -1
index 2af054f..308dfa0 100644
@@ -1,5 +1,5 @@
 #include "qemu-common.h"
-#include "ui/console.h"
+#include "sysemu/char.h"
 
 CharDriverState *vc_init(ChardevVC *vc)
 {
Signature · 1 line
MST
#2 lore raw
Quoted 20 lines · Riku Voipio
Quoted 15 lines · Michael S. Tsirkin

move generic chardev APIs to sysemu/char.h, to make them available to callers which can not depend on the whole of ui/console.h. This fixes a build error on systems without pixman-devel:

./configure --disable-tools --disable-docs --target-list=arm-linux-user
...
pixman none
...
make
...
In file included from /data/home/nchip/linaro/qemu/include/ui/console.h:4:0,
from /data/home/nchip/linaro/qemu/stubs/vc-init.c:2:
/data/home/nchip/linaro/qemu/include/ui/qemu-pixman.h:14:20: fatal
error: pixman.h: No such file or directory

Quoted 3 lines
 #include <pixman.h>
                    ^

compilation terminated.

Quoted 3 lines

This fix works for me, thanks.

Applied to master as a buildfix; thanks.

-- PMM