Browse Source

char: rename CharDriverState Chardev

Pick a uniform chardev type name.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Marc-André Lureau 8 years ago
parent
commit
0ec7b3e7f2
80 changed files with 496 additions and 493 deletions
  1. 29 27
      backends/baum.c
  2. 21 21
      backends/msmouse.c
  3. 2 2
      backends/rng-egd.c
  4. 14 14
      backends/testdev.c
  5. 6 6
      gdbstub.c
  6. 1 1
      hw/arm/fsl-imx25.c
  7. 1 1
      hw/arm/fsl-imx31.c
  8. 1 1
      hw/arm/fsl-imx6.c
  9. 1 1
      hw/arm/nseries.c
  10. 1 1
      hw/arm/omap2.c
  11. 1 1
      hw/arm/pxa2xx.c
  12. 1 1
      hw/arm/virt.c
  13. 7 7
      hw/bt/hci-csr.c
  14. 1 1
      hw/char/escc.c
  15. 1 1
      hw/char/exynos4210_uart.c
  16. 1 1
      hw/char/imx_serial.c
  17. 2 2
      hw/char/mcf_uart.c
  18. 3 3
      hw/char/omap_uart.c
  19. 1 1
      hw/char/parallel.c
  20. 1 1
      hw/char/serial-isa.c
  21. 2 2
      hw/char/serial.c
  22. 1 1
      hw/char/sh_serial.c
  23. 1 1
      hw/char/spapr_vty.c
  24. 1 1
      hw/char/virtio-console.c
  25. 2 2
      hw/core/qdev-properties-system.c
  26. 1 1
      hw/display/milkymist-tmu2.c
  27. 1 1
      hw/display/sm501.c
  28. 1 1
      hw/isa/isa-bus.c
  29. 1 1
      hw/isa/pc87312.c
  30. 2 2
      hw/lm32/lm32.h
  31. 1 1
      hw/lm32/milkymist-hw.h
  32. 2 2
      hw/mips/mips_malta.c
  33. 1 1
      hw/misc/ivshmem.c
  34. 1 1
      hw/misc/milkymist-pfpu.c
  35. 1 1
      hw/usb/ccid-card-passthru.c
  36. 3 3
      hw/usb/dev-serial.c
  37. 2 2
      hw/usb/redirect.c
  38. 1 1
      include/hw/arm/exynos4210.h
  39. 3 3
      include/hw/arm/omap.h
  40. 2 2
      include/hw/bt.h
  41. 1 1
      include/hw/char/cadence_uart.h
  42. 1 1
      include/hw/char/escc.h
  43. 2 2
      include/hw/char/pl011.h
  44. 2 2
      include/hw/char/serial.h
  45. 1 1
      include/hw/char/xilinx_uartlite.h
  46. 1 1
      include/hw/cris/etraxfs.h
  47. 1 1
      include/hw/devices.h
  48. 1 1
      include/hw/i386/pc.h
  49. 2 2
      include/hw/m68k/mcf.h
  50. 1 1
      include/hw/ppc/spapr_vio.h
  51. 1 1
      include/hw/qdev-properties.h
  52. 1 1
      include/hw/sh4/sh.h
  53. 1 1
      include/hw/sparc/grlib.h
  54. 1 1
      include/hw/xen/xen.h
  55. 1 1
      include/monitor/monitor.h
  56. 1 1
      include/qemu/typedefs.h
  57. 47 47
      include/sysemu/char.h
  58. 2 2
      include/sysemu/replay.h
  59. 2 2
      include/sysemu/sysemu.h
  60. 1 1
      include/ui/gtk.h
  61. 1 1
      include/ui/qemu-spice.h
  62. 2 2
      monitor.c
  63. 2 2
      net/colo-compare.c
  64. 2 2
      net/filter-mirror.c
  65. 1 1
      net/slirp.c
  66. 5 5
      net/vhost-user.c
  67. 189 188
      qemu-char.c
  68. 1 1
      qmp.c
  69. 1 1
      qtest.c
  70. 4 4
      replay/replay-char.c
  71. 40 40
      spice-qemu-char.c
  72. 1 1
      stubs/monitor.c
  73. 2 2
      stubs/replay.c
  74. 5 5
      tests/test-char.c
  75. 2 2
      tests/vhost-user-test.c
  76. 20 20
      ui/console.c
  77. 13 13
      ui/gtk.c
  78. 5 5
      vl.c
  79. 1 1
      xen-common-stub.c
  80. 2 2
      xen-common.c

+ 29 - 27
backends/baum.c

@@ -85,7 +85,7 @@
 #define BUF_SIZE 256
 #define BUF_SIZE 256
 
 
 typedef struct {
 typedef struct {
-    CharDriverState parent;
+    Chardev parent;
 
 
     brlapi_handle_t *brlapi;
     brlapi_handle_t *brlapi;
     int brlapi_fd;
     int brlapi_fd;
@@ -98,7 +98,7 @@ typedef struct {
     uint8_t out_buf_used, out_buf_ptr;
     uint8_t out_buf_used, out_buf_ptr;
 
 
     QEMUTimer *cellCount_timer;
     QEMUTimer *cellCount_timer;
-} BaumDriverState;
+} BaumChardev;
 
 
 /* Let's assume NABCC by default */
 /* Let's assume NABCC by default */
 enum way {
 enum way {
@@ -223,7 +223,7 @@ static const uint8_t nabcc_translation[2][256] = {
 };
 };
 
 
 /* The guest OS has started discussing with us, finish initializing BrlAPI */
 /* The guest OS has started discussing with us, finish initializing BrlAPI */
-static int baum_deferred_init(BaumDriverState *baum)
+static int baum_deferred_init(BaumChardev *baum)
 {
 {
     int tty = BRLAPI_TTY_DEFAULT;
     int tty = BRLAPI_TTY_DEFAULT;
     QemuConsole *con;
     QemuConsole *con;
@@ -253,9 +253,9 @@ static int baum_deferred_init(BaumDriverState *baum)
 }
 }
 
 
 /* The serial port can receive more of our data */
 /* The serial port can receive more of our data */
-static void baum_accept_input(struct CharDriverState *chr)
+static void baum_accept_input(struct Chardev *chr)
 {
 {
-    BaumDriverState *baum = (BaumDriverState *)chr;
+    BaumChardev *baum = (BaumChardev *)chr;
     int room, first;
     int room, first;
 
 
     if (!baum->out_buf_used)
     if (!baum->out_buf_used)
@@ -279,9 +279,9 @@ static void baum_accept_input(struct CharDriverState *chr)
 }
 }
 
 
 /* We want to send a packet */
 /* We want to send a packet */
-static void baum_write_packet(BaumDriverState *baum, const uint8_t *buf, int len)
+static void baum_write_packet(BaumChardev *baum, const uint8_t *buf, int len)
 {
 {
-    CharDriverState *chr = (CharDriverState *)baum;
+    Chardev *chr = (Chardev *)baum;
     uint8_t io_buf[1 + 2 * len], *cur = io_buf;
     uint8_t io_buf[1 + 2 * len], *cur = io_buf;
     int room;
     int room;
     *cur++ = ESC;
     *cur++ = ESC;
@@ -322,14 +322,14 @@ static void baum_write_packet(BaumDriverState *baum, const uint8_t *buf, int len
 /* Called when the other end seems to have a wrong idea of our display size */
 /* Called when the other end seems to have a wrong idea of our display size */
 static void baum_cellCount_timer_cb(void *opaque)
 static void baum_cellCount_timer_cb(void *opaque)
 {
 {
-    BaumDriverState *baum = opaque;
+    BaumChardev *baum = opaque;
     uint8_t cell_count[] = { BAUM_RSP_CellCount, baum->x * baum->y };
     uint8_t cell_count[] = { BAUM_RSP_CellCount, baum->x * baum->y };
     DPRINTF("Timeout waiting for DisplayData, sending cell count\n");
     DPRINTF("Timeout waiting for DisplayData, sending cell count\n");
     baum_write_packet(baum, cell_count, sizeof(cell_count));
     baum_write_packet(baum, cell_count, sizeof(cell_count));
 }
 }
 
 
 /* Try to interpret a whole incoming packet */
 /* Try to interpret a whole incoming packet */
-static int baum_eat_packet(BaumDriverState *baum, const uint8_t *buf, int len)
+static int baum_eat_packet(BaumChardev *baum, const uint8_t *buf, int len)
 {
 {
     const uint8_t *cur = buf;
     const uint8_t *cur = buf;
     uint8_t req = 0;
     uint8_t req = 0;
@@ -470,9 +470,9 @@ static int baum_eat_packet(BaumDriverState *baum, const uint8_t *buf, int len)
 }
 }
 
 
 /* The other end is writing some data.  Store it and try to interpret */
 /* The other end is writing some data.  Store it and try to interpret */
-static int baum_write(CharDriverState *chr, const uint8_t *buf, int len)
+static int baum_write(Chardev *chr, const uint8_t *buf, int len)
 {
 {
-    BaumDriverState *baum = (BaumDriverState *)chr;
+    BaumChardev *baum = (BaumChardev *)chr;
     int tocopy, cur, eaten, orig_len = len;
     int tocopy, cur, eaten, orig_len = len;
 
 
     if (!len)
     if (!len)
@@ -511,14 +511,16 @@ static int baum_write(CharDriverState *chr, const uint8_t *buf, int len)
 }
 }
 
 
 /* Send the key code to the other end */
 /* Send the key code to the other end */
-static void baum_send_key(BaumDriverState *baum, uint8_t type, uint8_t value) {
+static void baum_send_key(BaumChardev *baum, uint8_t type, uint8_t value)
+{
     uint8_t packet[] = { type, value };
     uint8_t packet[] = { type, value };
     DPRINTF("writing key %x %x\n", type, value);
     DPRINTF("writing key %x %x\n", type, value);
     baum_write_packet(baum, packet, sizeof(packet));
     baum_write_packet(baum, packet, sizeof(packet));
 }
 }
 
 
-static void baum_send_key2(BaumDriverState *baum, uint8_t type, uint8_t value,
-                           uint8_t value2) {
+static void baum_send_key2(BaumChardev *baum, uint8_t type, uint8_t value,
+                           uint8_t value2)
+{
     uint8_t packet[] = { type, value, value2 };
     uint8_t packet[] = { type, value, value2 };
     DPRINTF("writing key %x %x\n", type, value);
     DPRINTF("writing key %x %x\n", type, value);
     baum_write_packet(baum, packet, sizeof(packet));
     baum_write_packet(baum, packet, sizeof(packet));
@@ -527,7 +529,7 @@ static void baum_send_key2(BaumDriverState *baum, uint8_t type, uint8_t value,
 /* We got some data on the BrlAPI socket */
 /* We got some data on the BrlAPI socket */
 static void baum_chr_read(void *opaque)
 static void baum_chr_read(void *opaque)
 {
 {
-    BaumDriverState *baum = opaque;
+    BaumChardev *baum = opaque;
     brlapi_keyCode_t code;
     brlapi_keyCode_t code;
     int ret;
     int ret;
     if (!baum->brlapi)
     if (!baum->brlapi)
@@ -611,9 +613,9 @@ static void baum_chr_read(void *opaque)
     }
     }
 }
 }
 
 
-static void baum_free(struct CharDriverState *chr)
+static void baum_free(struct Chardev *chr)
 {
 {
-    BaumDriverState *baum = (BaumDriverState *)chr;
+    BaumChardev *baum = (BaumChardev *)chr;
 
 
     timer_free(baum->cellCount_timer);
     timer_free(baum->cellCount_timer);
     if (baum->brlapi) {
     if (baum->brlapi) {
@@ -622,23 +624,23 @@ static void baum_free(struct CharDriverState *chr)
     }
     }
 }
 }
 
 
-static CharDriverState *chr_baum_init(const CharDriver *driver,
-                                      const char *id,
-                                      ChardevBackend *backend,
-                                      ChardevReturn *ret,
-                                      bool *be_opened,
-                                      Error **errp)
+static Chardev *chr_baum_init(const CharDriver *driver,
+                              const char *id,
+                              ChardevBackend *backend,
+                              ChardevReturn *ret,
+                              bool *be_opened,
+                              Error **errp)
 {
 {
     ChardevCommon *common = backend->u.braille.data;
     ChardevCommon *common = backend->u.braille.data;
-    BaumDriverState *baum;
-    CharDriverState *chr;
+    BaumChardev *baum;
+    Chardev *chr;
     brlapi_handle_t *handle;
     brlapi_handle_t *handle;
 
 
     chr = qemu_chr_alloc(driver, common, errp);
     chr = qemu_chr_alloc(driver, common, errp);
     if (!chr) {
     if (!chr) {
         return NULL;
         return NULL;
     }
     }
-    baum = (BaumDriverState *)chr;
+    baum = (BaumChardev *)chr;
 
 
     handle = g_malloc0(brlapi_getHandleSize());
     handle = g_malloc0(brlapi_getHandleSize());
     baum->brlapi = handle;
     baum->brlapi = handle;
@@ -666,7 +668,7 @@ fail_handle:
 static void register_types(void)
 static void register_types(void)
 {
 {
     static const CharDriver driver = {
     static const CharDriver driver = {
-        .instance_size = sizeof(BaumDriverState),
+        .instance_size = sizeof(BaumChardev),
         .kind = CHARDEV_BACKEND_KIND_BRAILLE,
         .kind = CHARDEV_BACKEND_KIND_BRAILLE,
         .create = chr_baum_init,
         .create = chr_baum_init,
         .chr_write = baum_write,
         .chr_write = baum_write,

+ 21 - 21
backends/msmouse.c

@@ -31,7 +31,7 @@
 #define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6)
 #define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6)
 
 
 typedef struct {
 typedef struct {
-    CharDriverState parent;
+    Chardev parent;
 
 
     QemuInputHandlerState *hs;
     QemuInputHandlerState *hs;
     int axis[INPUT_AXIS__MAX];
     int axis[INPUT_AXIS__MAX];
@@ -39,11 +39,11 @@ typedef struct {
     bool btnc[INPUT_BUTTON__MAX];
     bool btnc[INPUT_BUTTON__MAX];
     uint8_t outbuf[32];
     uint8_t outbuf[32];
     int outlen;
     int outlen;
-} MouseState;
+} MouseChardev;
 
 
-static void msmouse_chr_accept_input(CharDriverState *chr)
+static void msmouse_chr_accept_input(Chardev *chr)
 {
 {
-    MouseState *mouse = (MouseState *)chr;
+    MouseChardev *mouse = (MouseChardev *)chr;
     int len;
     int len;
 
 
     len = qemu_chr_be_can_write(chr);
     len = qemu_chr_be_can_write(chr);
@@ -61,7 +61,7 @@ static void msmouse_chr_accept_input(CharDriverState *chr)
     }
     }
 }
 }
 
 
-static void msmouse_queue_event(MouseState *mouse)
+static void msmouse_queue_event(MouseChardev *mouse)
 {
 {
     unsigned char bytes[4] = { 0x40, 0x00, 0x00, 0x00 };
     unsigned char bytes[4] = { 0x40, 0x00, 0x00, 0x00 };
     int dx, dy, count = 3;
     int dx, dy, count = 3;
@@ -98,7 +98,7 @@ static void msmouse_queue_event(MouseState *mouse)
 static void msmouse_input_event(DeviceState *dev, QemuConsole *src,
 static void msmouse_input_event(DeviceState *dev, QemuConsole *src,
                                 InputEvent *evt)
                                 InputEvent *evt)
 {
 {
-    MouseState *mouse = (MouseState *)dev;
+    MouseChardev *mouse = (MouseChardev *)dev;
     InputMoveEvent *move;
     InputMoveEvent *move;
     InputBtnEvent *btn;
     InputBtnEvent *btn;
 
 
@@ -122,22 +122,22 @@ static void msmouse_input_event(DeviceState *dev, QemuConsole *src,
 
 
 static void msmouse_input_sync(DeviceState *dev)
 static void msmouse_input_sync(DeviceState *dev)
 {
 {
-    MouseState *mouse = (MouseState *)dev;
-    CharDriverState *chr = (CharDriverState *)dev;
+    MouseChardev *mouse = (MouseChardev *)dev;
+    Chardev *chr = (Chardev *)dev;
 
 
     msmouse_queue_event(mouse);
     msmouse_queue_event(mouse);
     msmouse_chr_accept_input(chr);
     msmouse_chr_accept_input(chr);
 }
 }
 
 
-static int msmouse_chr_write (struct CharDriverState *s, const uint8_t *buf, int len)
+static int msmouse_chr_write(struct Chardev *s, const uint8_t *buf, int len)
 {
 {
     /* Ignore writes to mouse port */
     /* Ignore writes to mouse port */
     return len;
     return len;
 }
 }
 
 
-static void msmouse_chr_free(struct CharDriverState *chr)
+static void msmouse_chr_free(struct Chardev *chr)
 {
 {
-    MouseState *mouse = (MouseState *)chr;
+    MouseChardev *mouse = (MouseChardev *)chr;
 
 
     qemu_input_handler_unregister(mouse->hs);
     qemu_input_handler_unregister(mouse->hs);
 }
 }
@@ -149,16 +149,16 @@ static QemuInputHandler msmouse_handler = {
     .sync  = msmouse_input_sync,
     .sync  = msmouse_input_sync,
 };
 };
 
 
-static CharDriverState *qemu_chr_open_msmouse(const CharDriver *driver,
-                                              const char *id,
-                                              ChardevBackend *backend,
-                                              ChardevReturn *ret,
-                                              bool *be_opened,
-                                              Error **errp)
+static Chardev *qemu_chr_open_msmouse(const CharDriver *driver,
+                                      const char *id,
+                                      ChardevBackend *backend,
+                                      ChardevReturn *ret,
+                                      bool *be_opened,
+                                      Error **errp)
 {
 {
     ChardevCommon *common = backend->u.msmouse.data;
     ChardevCommon *common = backend->u.msmouse.data;
-    MouseState *mouse;
-    CharDriverState *chr;
+    MouseChardev *mouse;
+    Chardev *chr;
 
 
     chr = qemu_chr_alloc(driver, common, errp);
     chr = qemu_chr_alloc(driver, common, errp);
     if (!chr) {
     if (!chr) {
@@ -166,7 +166,7 @@ static CharDriverState *qemu_chr_open_msmouse(const CharDriver *driver,
     }
     }
     *be_opened = false;
     *be_opened = false;
 
 
-    mouse = (MouseState *)chr;
+    mouse = (MouseChardev *)chr;
     mouse->hs = qemu_input_handler_register((DeviceState *)mouse,
     mouse->hs = qemu_input_handler_register((DeviceState *)mouse,
                                             &msmouse_handler);
                                             &msmouse_handler);
 
 
@@ -177,7 +177,7 @@ static CharDriverState *qemu_chr_open_msmouse(const CharDriver *driver,
 static void register_types(void)
 static void register_types(void)
 {
 {
     static const CharDriver driver = {
     static const CharDriver driver = {
-        .instance_size = sizeof(MouseState),
+        .instance_size = sizeof(MouseChardev),
         .kind = CHARDEV_BACKEND_KIND_MSMOUSE,
         .kind = CHARDEV_BACKEND_KIND_MSMOUSE,
         .create = qemu_chr_open_msmouse,
         .create = qemu_chr_open_msmouse,
         .chr_write = msmouse_chr_write,
         .chr_write = msmouse_chr_write,

+ 2 - 2
backends/rng-egd.c

@@ -86,7 +86,7 @@ static void rng_egd_chr_read(void *opaque, const uint8_t *buf, int size)
 static void rng_egd_opened(RngBackend *b, Error **errp)
 static void rng_egd_opened(RngBackend *b, Error **errp)
 {
 {
     RngEgd *s = RNG_EGD(b);
     RngEgd *s = RNG_EGD(b);
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     if (s->chr_name == NULL) {
     if (s->chr_name == NULL) {
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
@@ -125,7 +125,7 @@ static void rng_egd_set_chardev(Object *obj, const char *value, Error **errp)
 static char *rng_egd_get_chardev(Object *obj, Error **errp)
 static char *rng_egd_get_chardev(Object *obj, Error **errp)
 {
 {
     RngEgd *s = RNG_EGD(obj);
     RngEgd *s = RNG_EGD(obj);
-    CharDriverState *chr = qemu_chr_fe_get_driver(&s->chr);
+    Chardev *chr = qemu_chr_fe_get_driver(&s->chr);
 
 
     if (chr && chr->label) {
     if (chr && chr->label) {
         return g_strdup(chr->label);
         return g_strdup(chr->label);

+ 14 - 14
backends/testdev.c

@@ -30,14 +30,14 @@
 #define BUF_SIZE 32
 #define BUF_SIZE 32
 
 
 typedef struct {
 typedef struct {
-    CharDriverState parent;
+    Chardev parent;
 
 
     uint8_t in_buf[32];
     uint8_t in_buf[32];
     int in_buf_used;
     int in_buf_used;
-} TestdevCharState;
+} TestdevChardev;
 
 
 /* Try to interpret a whole incoming packet */
 /* Try to interpret a whole incoming packet */
-static int testdev_eat_packet(TestdevCharState *testdev)
+static int testdev_eat_packet(TestdevChardev *testdev)
 {
 {
     const uint8_t *cur = testdev->in_buf;
     const uint8_t *cur = testdev->in_buf;
     int len = testdev->in_buf_used;
     int len = testdev->in_buf_used;
@@ -78,9 +78,9 @@ static int testdev_eat_packet(TestdevCharState *testdev)
 }
 }
 
 
 /* The other end is writing some data.  Store it and try to interpret */
 /* The other end is writing some data.  Store it and try to interpret */
-static int testdev_write(CharDriverState *chr, const uint8_t *buf, int len)
+static int testdev_write(Chardev *chr, const uint8_t *buf, int len)
 {
 {
-    TestdevCharState *testdev = (TestdevCharState *)chr;
+    TestdevChardev *testdev = (TestdevChardev *)chr;
     int tocopy, eaten, orig_len = len;
     int tocopy, eaten, orig_len = len;
 
 
     while (len) {
     while (len) {
@@ -103,15 +103,15 @@ static int testdev_write(CharDriverState *chr, const uint8_t *buf, int len)
     return orig_len;
     return orig_len;
 }
 }
 
 
-static CharDriverState *chr_testdev_init(const CharDriver *driver,
-                                         const char *id,
-                                         ChardevBackend *backend,
-                                         ChardevReturn *ret,
-                                         bool *be_opened,
-                                         Error **errp)
+static Chardev *chr_testdev_init(const CharDriver *driver,
+                                 const char *id,
+                                 ChardevBackend *backend,
+                                 ChardevReturn *ret,
+                                 bool *be_opened,
+                                 Error **errp)
 {
 {
-    TestdevCharState *testdev = g_new0(TestdevCharState, 1);;
-    CharDriverState *chr = (CharDriverState *)testdev;
+    TestdevChardev *testdev = g_new0(TestdevChardev, 1);;
+    Chardev *chr = (Chardev *)testdev;
 
 
     chr->driver = driver;
     chr->driver = driver;
 
 
@@ -121,7 +121,7 @@ static CharDriverState *chr_testdev_init(const CharDriver *driver,
 static void register_types(void)
 static void register_types(void)
 {
 {
     static const CharDriver driver = {
     static const CharDriver driver = {
-        .instance_size = sizeof(TestdevCharState),
+        .instance_size = sizeof(TestdevChardev),
         .kind = CHARDEV_BACKEND_KIND_TESTDEV,
         .kind = CHARDEV_BACKEND_KIND_TESTDEV,
         .create = chr_testdev_init,
         .create = chr_testdev_init,
         .chr_write = testdev_write,
         .chr_write = testdev_write,

+ 6 - 6
gdbstub.c

@@ -305,7 +305,7 @@ typedef struct GDBState {
     int running_state;
     int running_state;
 #else
 #else
     CharBackend chr;
     CharBackend chr;
-    CharDriverState *mon_chr;
+    Chardev *mon_chr;
 #endif
 #endif
     char syscall_buf[256];
     char syscall_buf[256];
     gdb_syscall_complete_cb current_syscall_cb;
     gdb_syscall_complete_cb current_syscall_cb;
@@ -1473,7 +1473,7 @@ void gdb_exit(CPUArchState *env, int code)
   GDBState *s;
   GDBState *s;
   char buf[4];
   char buf[4];
 #ifndef CONFIG_USER_ONLY
 #ifndef CONFIG_USER_ONLY
-  CharDriverState *chr;
+  Chardev *chr;
 #endif
 #endif
 
 
   s = gdbserver_state;
   s = gdbserver_state;
@@ -1698,7 +1698,7 @@ static void gdb_monitor_output(GDBState *s, const char *msg, int len)
     put_packet(s, buf);
     put_packet(s, buf);
 }
 }
 
 
-static int gdb_monitor_write(CharDriverState *chr, const uint8_t *buf, int len)
+static int gdb_monitor_write(Chardev *chr, const uint8_t *buf, int len)
 {
 {
     const char *p = (const char *)buf;
     const char *p = (const char *)buf;
     int max_sz;
     int max_sz;
@@ -1729,11 +1729,11 @@ int gdbserver_start(const char *device)
 {
 {
     GDBState *s;
     GDBState *s;
     char gdbstub_device_name[128];
     char gdbstub_device_name[128];
-    CharDriverState *chr = NULL;
-    CharDriverState *mon_chr;
+    Chardev *chr = NULL;
+    Chardev *mon_chr;
     ChardevCommon common = { 0 };
     ChardevCommon common = { 0 };
     static const CharDriver driver = {
     static const CharDriver driver = {
-        .instance_size = sizeof(CharDriverState),
+        .instance_size = sizeof(Chardev),
         .kind = -1,
         .kind = -1,
         .chr_write = gdb_monitor_write,
         .chr_write = gdb_monitor_write,
     };
     };

+ 1 - 1
hw/arm/fsl-imx25.c

@@ -118,7 +118,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
         };
         };
 
 
         if (i < MAX_SERIAL_PORTS) {
         if (i < MAX_SERIAL_PORTS) {
-            CharDriverState *chr;
+            Chardev *chr;
 
 
             chr = serial_hds[i];
             chr = serial_hds[i];
 
 

+ 1 - 1
hw/arm/fsl-imx31.c

@@ -107,7 +107,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
         };
         };
 
 
         if (i < MAX_SERIAL_PORTS) {
         if (i < MAX_SERIAL_PORTS) {
-            CharDriverState *chr;
+            Chardev *chr;
 
 
             chr = serial_hds[i];
             chr = serial_hds[i];
 
 

+ 1 - 1
hw/arm/fsl-imx6.c

@@ -187,7 +187,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
         };
         };
 
 
         if (i < MAX_SERIAL_PORTS) {
         if (i < MAX_SERIAL_PORTS) {
-            CharDriverState *chr;
+            Chardev *chr;
 
 
             chr = serial_hds[i];
             chr = serial_hds[i];
 
 

+ 1 - 1
hw/arm/nseries.c

@@ -786,7 +786,7 @@ static void n8x0_cbus_setup(struct n800_s *s)
 
 
 static void n8x0_uart_setup(struct n800_s *s)
 static void n8x0_uart_setup(struct n800_s *s)
 {
 {
-    CharDriverState *radio = uart_hci_init();
+    Chardev *radio = uart_hci_init();
 
 
     qdev_connect_gpio_out(s->mpu->gpio, N8X0_BT_RESET_GPIO,
     qdev_connect_gpio_out(s->mpu->gpio, N8X0_BT_RESET_GPIO,
                     csrhci_pins_get(radio)[csrhci_pin_reset]);
                     csrhci_pins_get(radio)[csrhci_pin_reset]);

+ 1 - 1
hw/arm/omap2.c

@@ -792,7 +792,7 @@ static const MemoryRegionOps omap_sti_fifo_ops = {
 static struct omap_sti_s *omap_sti_init(struct omap_target_agent_s *ta,
 static struct omap_sti_s *omap_sti_init(struct omap_target_agent_s *ta,
                 MemoryRegion *sysmem,
                 MemoryRegion *sysmem,
                 hwaddr channel_base, qemu_irq irq, omap_clk clk,
                 hwaddr channel_base, qemu_irq irq, omap_clk clk,
-                CharDriverState *chr)
+                Chardev *chr)
 {
 {
     struct omap_sti_s *s = g_new0(struct omap_sti_s, 1);
     struct omap_sti_s *s = g_new0(struct omap_sti_s, 1);
 
 

+ 1 - 1
hw/arm/pxa2xx.c

@@ -2024,7 +2024,7 @@ static PXA2xxFIrState *pxa2xx_fir_init(MemoryRegion *sysmem,
                                        hwaddr base,
                                        hwaddr base,
                                        qemu_irq irq, qemu_irq rx_dma,
                                        qemu_irq irq, qemu_irq rx_dma,
                                        qemu_irq tx_dma,
                                        qemu_irq tx_dma,
-                                       CharDriverState *chr)
+                                       Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     SysBusDevice *sbd;
     SysBusDevice *sbd;

+ 1 - 1
hw/arm/virt.c

@@ -613,7 +613,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic)
 }
 }
 
 
 static void create_uart(const VirtMachineState *vms, qemu_irq *pic, int uart,
 static void create_uart(const VirtMachineState *vms, qemu_irq *pic, int uart,
-                        MemoryRegion *mem, CharDriverState *chr)
+                        MemoryRegion *mem, Chardev *chr)
 {
 {
     char *nodename;
     char *nodename;
     hwaddr base = vms->memmap[uart].base;
     hwaddr base = vms->memmap[uart].base;

+ 7 - 7
hw/bt/hci-csr.c

@@ -29,7 +29,7 @@
 #include "qapi/error.h"
 #include "qapi/error.h"
 
 
 struct csrhci_s {
 struct csrhci_s {
-    CharDriverState parent;
+    Chardev parent;
     int enable;
     int enable;
     qemu_irq *pins;
     qemu_irq *pins;
     int pin_state;
     int pin_state;
@@ -79,7 +79,7 @@ enum {
 
 
 static inline void csrhci_fifo_wake(struct csrhci_s *s)
 static inline void csrhci_fifo_wake(struct csrhci_s *s)
 {
 {
-    CharDriverState *chr = (CharDriverState *)s;
+    Chardev *chr = (Chardev *)s;
     CharBackend *be = chr->be;
     CharBackend *be = chr->be;
 
 
     if (!s->enable || !s->out_len)
     if (!s->enable || !s->out_len)
@@ -313,7 +313,7 @@ static void csrhci_ready_for_next_inpkt(struct csrhci_s *s)
     s->in_hdr = INT_MAX;
     s->in_hdr = INT_MAX;
 }
 }
 
 
-static int csrhci_write(struct CharDriverState *chr,
+static int csrhci_write(struct Chardev *chr,
                 const uint8_t *buf, int len)
                 const uint8_t *buf, int len)
 {
 {
     struct csrhci_s *s = (struct csrhci_s *)chr;
     struct csrhci_s *s = (struct csrhci_s *)chr;
@@ -386,7 +386,7 @@ static void csrhci_out_hci_packet_acl(void *opaque,
     csrhci_fifo_wake(s);
     csrhci_fifo_wake(s);
 }
 }
 
 
-static int csrhci_ioctl(struct CharDriverState *chr, int cmd, void *arg)
+static int csrhci_ioctl(struct Chardev *chr, int cmd, void *arg)
 {
 {
     QEMUSerialSetParams *ssp;
     QEMUSerialSetParams *ssp;
     struct csrhci_s *s = (struct csrhci_s *) chr;
     struct csrhci_s *s = (struct csrhci_s *) chr;
@@ -455,14 +455,14 @@ static void csrhci_pins(void *opaque, int line, int level)
     }
     }
 }
 }
 
 
-qemu_irq *csrhci_pins_get(CharDriverState *chr)
+qemu_irq *csrhci_pins_get(Chardev *chr)
 {
 {
     struct csrhci_s *s = (struct csrhci_s *) chr;
     struct csrhci_s *s = (struct csrhci_s *) chr;
 
 
     return s->pins;
     return s->pins;
 }
 }
 
 
-CharDriverState *uart_hci_init(void)
+Chardev *uart_hci_init(void)
 {
 {
     static const CharDriver hci_driver = {
     static const CharDriver hci_driver = {
         .instance_size = sizeof(struct csrhci_s),
         .instance_size = sizeof(struct csrhci_s),
@@ -472,7 +472,7 @@ CharDriverState *uart_hci_init(void)
     };
     };
     Error *err = NULL;
     Error *err = NULL;
     ChardevCommon common = { 0, };
     ChardevCommon common = { 0, };
-    CharDriverState *chr = qemu_chr_alloc(&hci_driver, &common, &err);
+    Chardev *chr = qemu_chr_alloc(&hci_driver, &common, &err);
     struct csrhci_s *s = (struct csrhci_s *)chr;
     struct csrhci_s *s = (struct csrhci_s *)chr;
 
 
     if (err) {
     if (err) {

+ 1 - 1
hw/char/escc.c

@@ -689,7 +689,7 @@ static const VMStateDescription vmstate_escc = {
 };
 };
 
 
 MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB,
 MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB,
-              CharDriverState *chrA, CharDriverState *chrB,
+              Chardev *chrA, Chardev *chrB,
               int clock, int it_shift)
               int clock, int it_shift)
 {
 {
     DeviceState *dev;
     DeviceState *dev;

+ 1 - 1
hw/char/exynos4210_uart.c

@@ -586,7 +586,7 @@ static const VMStateDescription vmstate_exynos4210_uart = {
 DeviceState *exynos4210_uart_create(hwaddr addr,
 DeviceState *exynos4210_uart_create(hwaddr addr,
                                     int fifo_size,
                                     int fifo_size,
                                     int channel,
                                     int channel,
-                                    CharDriverState *chr,
+                                    Chardev *chr,
                                     qemu_irq irq)
                                     qemu_irq irq)
 {
 {
     DeviceState  *dev;
     DeviceState  *dev;

+ 1 - 1
hw/char/imx_serial.c

@@ -170,7 +170,7 @@ static void imx_serial_write(void *opaque, hwaddr offset,
                              uint64_t value, unsigned size)
                              uint64_t value, unsigned size)
 {
 {
     IMXSerialState *s = (IMXSerialState *)opaque;
     IMXSerialState *s = (IMXSerialState *)opaque;
-    CharDriverState *chr = qemu_chr_fe_get_driver(&s->chr);
+    Chardev *chr = qemu_chr_fe_get_driver(&s->chr);
     unsigned char ch;
     unsigned char ch;
 
 
     DPRINTF("write(offset=0x%" HWADDR_PRIx ", value = 0x%x) to %s\n",
     DPRINTF("write(offset=0x%" HWADDR_PRIx ", value = 0x%x) to %s\n",

+ 2 - 2
hw/char/mcf_uart.c

@@ -275,7 +275,7 @@ static void mcf_uart_receive(void *opaque, const uint8_t *buf, int size)
     mcf_uart_push_byte(s, buf[0]);
     mcf_uart_push_byte(s, buf[0]);
 }
 }
 
 
-void *mcf_uart_init(qemu_irq irq, CharDriverState *chr)
+void *mcf_uart_init(qemu_irq irq, Chardev *chr)
 {
 {
     mcf_uart_state *s;
     mcf_uart_state *s;
 
 
@@ -300,7 +300,7 @@ static const MemoryRegionOps mcf_uart_ops = {
 void mcf_uart_mm_init(MemoryRegion *sysmem,
 void mcf_uart_mm_init(MemoryRegion *sysmem,
                       hwaddr base,
                       hwaddr base,
                       qemu_irq irq,
                       qemu_irq irq,
-                      CharDriverState *chr)
+                      Chardev *chr)
 {
 {
     mcf_uart_state *s;
     mcf_uart_state *s;
 
 

+ 3 - 3
hw/char/omap_uart.c

@@ -54,7 +54,7 @@ void omap_uart_reset(struct omap_uart_s *s)
 struct omap_uart_s *omap_uart_init(hwaddr base,
 struct omap_uart_s *omap_uart_init(hwaddr base,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
                 qemu_irq txdma, qemu_irq rxdma,
                 qemu_irq txdma, qemu_irq rxdma,
-                const char *label, CharDriverState *chr)
+                const char *label, Chardev *chr)
 {
 {
     struct omap_uart_s *s = g_new0(struct omap_uart_s, 1);
     struct omap_uart_s *s = g_new0(struct omap_uart_s, 1);
 
 
@@ -163,7 +163,7 @@ struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
                 struct omap_target_agent_s *ta,
                 struct omap_target_agent_s *ta,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
                 qemu_irq txdma, qemu_irq rxdma,
                 qemu_irq txdma, qemu_irq rxdma,
-                const char *label, CharDriverState *chr)
+                const char *label, Chardev *chr)
 {
 {
     hwaddr base = omap_l4_attach(ta, 0, NULL);
     hwaddr base = omap_l4_attach(ta, 0, NULL);
     struct omap_uart_s *s = omap_uart_init(base, irq,
     struct omap_uart_s *s = omap_uart_init(base, irq,
@@ -178,7 +178,7 @@ struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
     return s;
     return s;
 }
 }
 
 
-void omap_uart_attach(struct omap_uart_s *s, CharDriverState *chr)
+void omap_uart_attach(struct omap_uart_s *s, Chardev *chr)
 {
 {
     /* TODO: Should reuse or destroy current s->serial */
     /* TODO: Should reuse or destroy current s->serial */
     s->serial = serial_mm_init(get_system_memory(), s->base, 2, s->irq,
     s->serial = serial_mm_init(get_system_memory(), s->base, 2, s->irq,

+ 1 - 1
hw/char/parallel.c

@@ -603,7 +603,7 @@ static const MemoryRegionOps parallel_mm_ops = {
 /* If fd is zero, it means that the parallel device uses the console */
 /* If fd is zero, it means that the parallel device uses the console */
 bool parallel_mm_init(MemoryRegion *address_space,
 bool parallel_mm_init(MemoryRegion *address_space,
                       hwaddr base, int it_shift, qemu_irq irq,
                       hwaddr base, int it_shift, qemu_irq irq,
-                      CharDriverState *chr)
+                      Chardev *chr)
 {
 {
     ParallelState *s;
     ParallelState *s;
 
 

+ 1 - 1
hw/char/serial-isa.c

@@ -121,7 +121,7 @@ static void serial_register_types(void)
 
 
 type_init(serial_register_types)
 type_init(serial_register_types)
 
 
-static void serial_isa_init(ISABus *bus, int index, CharDriverState *chr)
+static void serial_isa_init(ISABus *bus, int index, Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     ISADevice *isadev;
     ISADevice *isadev;

+ 2 - 2
hw/char/serial.c

@@ -937,7 +937,7 @@ const MemoryRegionOps serial_io_ops = {
 };
 };
 
 
 SerialState *serial_init(int base, qemu_irq irq, int baudbase,
 SerialState *serial_init(int base, qemu_irq irq, int baudbase,
-                         CharDriverState *chr, MemoryRegion *system_io)
+                         Chardev *chr, MemoryRegion *system_io)
 {
 {
     SerialState *s;
     SerialState *s;
 
 
@@ -993,7 +993,7 @@ static const MemoryRegionOps serial_mm_ops[3] = {
 SerialState *serial_mm_init(MemoryRegion *address_space,
 SerialState *serial_mm_init(MemoryRegion *address_space,
                             hwaddr base, int it_shift,
                             hwaddr base, int it_shift,
                             qemu_irq irq, int baudbase,
                             qemu_irq irq, int baudbase,
-                            CharDriverState *chr, enum device_endian end)
+                            Chardev *chr, enum device_endian end)
 {
 {
     SerialState *s;
     SerialState *s;
 
 

+ 1 - 1
hw/char/sh_serial.c

@@ -356,7 +356,7 @@ static const MemoryRegionOps sh_serial_ops = {
 
 
 void sh_serial_init(MemoryRegion *sysmem,
 void sh_serial_init(MemoryRegion *sysmem,
                     hwaddr base, int feat,
                     hwaddr base, int feat,
-                    uint32_t freq, CharDriverState *chr,
+                    uint32_t freq, Chardev *chr,
                     qemu_irq eri_source,
                     qemu_irq eri_source,
                     qemu_irq rxi_source,
                     qemu_irq rxi_source,
                     qemu_irq txi_source,
                     qemu_irq txi_source,

+ 1 - 1
hw/char/spapr_vty.c

@@ -141,7 +141,7 @@ static target_ulong h_get_term_char(PowerPCCPU *cpu, sPAPRMachineState *spapr,
     return H_SUCCESS;
     return H_SUCCESS;
 }
 }
 
 
-void spapr_vty_create(VIOsPAPRBus *bus, CharDriverState *chardev)
+void spapr_vty_create(VIOsPAPRBus *bus, Chardev *chardev)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
 
 

+ 1 - 1
hw/char/virtio-console.c

@@ -168,7 +168,7 @@ static void virtconsole_realize(DeviceState *dev, Error **errp)
     VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev);
     VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev);
     VirtConsole *vcon = VIRTIO_CONSOLE(dev);
     VirtConsole *vcon = VIRTIO_CONSOLE(dev);
     VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(dev);
     VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(dev);
-    CharDriverState *chr = qemu_chr_fe_get_driver(&vcon->chr);
+    Chardev *chr = qemu_chr_fe_get_driver(&vcon->chr);
 
 
     if (port->id == 0 && !k->is_console) {
     if (port->id == 0 && !k->is_console) {
         error_setg(errp, "Port number 0 on virtio-serial devices reserved "
         error_setg(errp, "Port number 0 on virtio-serial devices reserved "

+ 2 - 2
hw/core/qdev-properties-system.c

@@ -179,7 +179,7 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,
     Error *local_err = NULL;
     Error *local_err = NULL;
     Property *prop = opaque;
     Property *prop = opaque;
     CharBackend *be = qdev_get_prop_ptr(dev, prop);
     CharBackend *be = qdev_get_prop_ptr(dev, prop);
-    CharDriverState *s;
+    Chardev *s;
     char *str;
     char *str;
 
 
     if (dev->realized) {
     if (dev->realized) {
@@ -411,7 +411,7 @@ void qdev_prop_set_drive(DeviceState *dev, const char *name,
 }
 }
 
 
 void qdev_prop_set_chr(DeviceState *dev, const char *name,
 void qdev_prop_set_chr(DeviceState *dev, const char *name,
-                       CharDriverState *value)
+                       Chardev *value)
 {
 {
     assert(!value || value->label);
     assert(!value || value->label);
     object_property_set_str(OBJECT(dev),
     object_property_set_str(OBJECT(dev),

+ 1 - 1
hw/display/milkymist-tmu2.c

@@ -85,7 +85,7 @@ struct MilkymistTMU2State {
     SysBusDevice parent_obj;
     SysBusDevice parent_obj;
 
 
     MemoryRegion regs_region;
     MemoryRegion regs_region;
-    CharDriverState *chr;
+    Chardev *chr;
     qemu_irq irq;
     qemu_irq irq;
 
 
     uint32_t regs[R_MAX];
     uint32_t regs[R_MAX];

+ 1 - 1
hw/display/sm501.c

@@ -1392,7 +1392,7 @@ static const GraphicHwOps sm501_ops = {
 };
 };
 
 
 void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
 void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
-                uint32_t local_mem_bytes, qemu_irq irq, CharDriverState *chr)
+                uint32_t local_mem_bytes, qemu_irq irq, Chardev *chr)
 {
 {
     SM501State * s;
     SM501State * s;
     DeviceState *dev;
     DeviceState *dev;

+ 1 - 1
hw/isa/isa-bus.c

@@ -288,7 +288,7 @@ MemoryRegion *isa_address_space_io(ISADevice *dev)
 
 
 type_init(isabus_register_types)
 type_init(isabus_register_types)
 
 
-static void parallel_init(ISABus *bus, int index, CharDriverState *chr)
+static void parallel_init(ISABus *bus, int index, Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     ISADevice *isadev;
     ISADevice *isadev;

+ 1 - 1
hw/isa/pc87312.c

@@ -268,7 +268,7 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
     DeviceState *d;
     DeviceState *d;
     ISADevice *isa;
     ISADevice *isa;
     ISABus *bus;
     ISABus *bus;
-    CharDriverState *chr;
+    Chardev *chr;
     DriveInfo *drive;
     DriveInfo *drive;
     char name[5];
     char name[5];
     int i;
     int i;

+ 2 - 2
hw/lm32/lm32.h

@@ -16,7 +16,7 @@ static inline DeviceState *lm32_pic_init(qemu_irq cpu_irq)
     return dev;
     return dev;
 }
 }
 
 
-static inline DeviceState *lm32_juart_init(CharDriverState *chr)
+static inline DeviceState *lm32_juart_init(Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
 
 
@@ -29,7 +29,7 @@ static inline DeviceState *lm32_juart_init(CharDriverState *chr)
 
 
 static inline DeviceState *lm32_uart_create(hwaddr addr,
 static inline DeviceState *lm32_uart_create(hwaddr addr,
                                             qemu_irq irq,
                                             qemu_irq irq,
-                                            CharDriverState *chr)
+                                            Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     SysBusDevice *s;
     SysBusDevice *s;

+ 1 - 1
hw/lm32/milkymist-hw.h

@@ -6,7 +6,7 @@
 
 
 static inline DeviceState *milkymist_uart_create(hwaddr base,
 static inline DeviceState *milkymist_uart_create(hwaddr base,
                                                  qemu_irq irq,
                                                  qemu_irq irq,
-                                                 CharDriverState *chr)
+                                                 Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
 
 

+ 2 - 2
hw/mips/mips_malta.c

@@ -551,10 +551,10 @@ static void malta_fgpa_display_event(void *opaque, int event)
 }
 }
 
 
 static MaltaFPGAState *malta_fpga_init(MemoryRegion *address_space,
 static MaltaFPGAState *malta_fpga_init(MemoryRegion *address_space,
-         hwaddr base, qemu_irq uart_irq, CharDriverState *uart_chr)
+         hwaddr base, qemu_irq uart_irq, Chardev *uart_chr)
 {
 {
     MaltaFPGAState *s;
     MaltaFPGAState *s;
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     s = (MaltaFPGAState *)g_malloc0(sizeof(MaltaFPGAState));
     s = (MaltaFPGAState *)g_malloc0(sizeof(MaltaFPGAState));
 
 

+ 1 - 1
hw/misc/ivshmem.c

@@ -869,7 +869,7 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
         s->ivshmem_bar2 = host_memory_backend_get_memory(s->hostmem,
         s->ivshmem_bar2 = host_memory_backend_get_memory(s->hostmem,
                                                          &error_abort);
                                                          &error_abort);
     } else {
     } else {
-        CharDriverState *chr = qemu_chr_fe_get_driver(&s->server_chr);
+        Chardev *chr = qemu_chr_fe_get_driver(&s->server_chr);
         assert(chr);
         assert(chr);
 
 
         IVSHMEM_DPRINTF("using shared memory server (socket = %s)\n",
         IVSHMEM_DPRINTF("using shared memory server (socket = %s)\n",

+ 1 - 1
hw/misc/milkymist-pfpu.c

@@ -125,7 +125,7 @@ struct MilkymistPFPUState {
     SysBusDevice parent_obj;
     SysBusDevice parent_obj;
 
 
     MemoryRegion regs_region;
     MemoryRegion regs_region;
-    CharDriverState *chr;
+    Chardev *chr;
     qemu_irq irq;
     qemu_irq irq;
 
 
     uint32_t regs[R_MAX];
     uint32_t regs[R_MAX];

+ 1 - 1
hw/usb/ccid-card-passthru.c

@@ -264,7 +264,7 @@ static void ccid_card_vscard_handle_message(PassthruState *card,
 
 
 static void ccid_card_vscard_drop_connection(PassthruState *card)
 static void ccid_card_vscard_drop_connection(PassthruState *card)
 {
 {
-    CharDriverState *chr = qemu_chr_fe_get_driver(&card->cs);
+    Chardev *chr = qemu_chr_fe_get_driver(&card->cs);
 
 
     qemu_chr_fe_deinit(&card->cs);
     qemu_chr_fe_deinit(&card->cs);
     qemu_chr_delete(chr);
     qemu_chr_delete(chr);

+ 3 - 3
hw/usb/dev-serial.c

@@ -483,7 +483,7 @@ static void usb_serial_realize(USBDevice *dev, Error **errp)
 {
 {
     USBSerialState *s = USB_SERIAL_DEV(dev);
     USBSerialState *s = USB_SERIAL_DEV(dev);
     Error *local_err = NULL;
     Error *local_err = NULL;
-    CharDriverState *chr = qemu_chr_fe_get_driver(&s->cs);
+    Chardev *chr = qemu_chr_fe_get_driver(&s->cs);
 
 
     usb_desc_create_serial(dev);
     usb_desc_create_serial(dev);
     usb_desc_init(dev);
     usb_desc_init(dev);
@@ -512,7 +512,7 @@ static void usb_serial_realize(USBDevice *dev, Error **errp)
 static USBDevice *usb_serial_init(USBBus *bus, const char *filename)
 static USBDevice *usb_serial_init(USBBus *bus, const char *filename)
 {
 {
     USBDevice *dev;
     USBDevice *dev;
-    CharDriverState *cdrv;
+    Chardev *cdrv;
     uint32_t vendorid = 0, productid = 0;
     uint32_t vendorid = 0, productid = 0;
     char label[32];
     char label[32];
     static int index;
     static int index;
@@ -564,7 +564,7 @@ static USBDevice *usb_serial_init(USBBus *bus, const char *filename)
 static USBDevice *usb_braille_init(USBBus *bus, const char *unused)
 static USBDevice *usb_braille_init(USBBus *bus, const char *unused)
 {
 {
     USBDevice *dev;
     USBDevice *dev;
-    CharDriverState *cdrv;
+    Chardev *cdrv;
 
 
     cdrv = qemu_chr_new("braille", "braille");
     cdrv = qemu_chr_new("braille", "braille");
     if (!cdrv)
     if (!cdrv)

+ 2 - 2
hw/usb/redirect.c

@@ -284,7 +284,7 @@ static gboolean usbredir_write_unblocked(GIOChannel *chan, GIOCondition cond,
 static int usbredir_write(void *priv, uint8_t *data, int count)
 static int usbredir_write(void *priv, uint8_t *data, int count)
 {
 {
     USBRedirDevice *dev = priv;
     USBRedirDevice *dev = priv;
-    CharDriverState *chr = qemu_chr_fe_get_driver(&dev->cs);
+    Chardev *chr = qemu_chr_fe_get_driver(&dev->cs);
     int r;
     int r;
 
 
     if (!chr->be_open) {
     if (!chr->be_open) {
@@ -1430,7 +1430,7 @@ static void usbredir_cleanup_device_queues(USBRedirDevice *dev)
 static void usbredir_handle_destroy(USBDevice *udev)
 static void usbredir_handle_destroy(USBDevice *udev)
 {
 {
     USBRedirDevice *dev = USB_REDIRECT(udev);
     USBRedirDevice *dev = USB_REDIRECT(udev);
-    CharDriverState *chr = qemu_chr_fe_get_driver(&dev->cs);
+    Chardev *chr = qemu_chr_fe_get_driver(&dev->cs);
 
 
     qemu_chr_fe_deinit(&dev->cs);
     qemu_chr_fe_deinit(&dev->cs);
     qemu_chr_delete(chr);
     qemu_chr_delete(chr);

+ 1 - 1
include/hw/arm/exynos4210.h

@@ -131,7 +131,7 @@ void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, DeviceState *dev,
 DeviceState *exynos4210_uart_create(hwaddr addr,
 DeviceState *exynos4210_uart_create(hwaddr addr,
                                     int fifo_size,
                                     int fifo_size,
                                     int channel,
                                     int channel,
-                                    CharDriverState *chr,
+                                    Chardev *chr,
                                     qemu_irq irq);
                                     qemu_irq irq);
 
 
 #endif /* EXYNOS4210_H */
 #endif /* EXYNOS4210_H */

+ 3 - 3
include/hw/arm/omap.h

@@ -664,14 +664,14 @@ struct omap_uart_s;
 struct omap_uart_s *omap_uart_init(hwaddr base,
 struct omap_uart_s *omap_uart_init(hwaddr base,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
                 qemu_irq txdma, qemu_irq rxdma,
                 qemu_irq txdma, qemu_irq rxdma,
-                const char *label, CharDriverState *chr);
+                const char *label, Chardev *chr);
 struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
 struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
                 struct omap_target_agent_s *ta,
                 struct omap_target_agent_s *ta,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
                 qemu_irq irq, omap_clk fclk, omap_clk iclk,
                 qemu_irq txdma, qemu_irq rxdma,
                 qemu_irq txdma, qemu_irq rxdma,
-                const char *label, CharDriverState *chr);
+                const char *label, Chardev *chr);
 void omap_uart_reset(struct omap_uart_s *s);
 void omap_uart_reset(struct omap_uart_s *s);
-void omap_uart_attach(struct omap_uart_s *s, CharDriverState *chr);
+void omap_uart_attach(struct omap_uart_s *s, Chardev *chr);
 
 
 struct omap_mpuio_s;
 struct omap_mpuio_s;
 qemu_irq *omap_mpuio_in_get(struct omap_mpuio_s *s);
 qemu_irq *omap_mpuio_in_get(struct omap_mpuio_s *s);

+ 2 - 2
include/hw/bt.h

@@ -127,8 +127,8 @@ enum {
     csrhci_pin_wakeup,
     csrhci_pin_wakeup,
     __csrhci_pins,
     __csrhci_pins,
 };
 };
-qemu_irq *csrhci_pins_get(CharDriverState *chr);
-CharDriverState *uart_hci_init(void);
+qemu_irq *csrhci_pins_get(Chardev *chr);
+Chardev *uart_hci_init(void);
 
 
 /* bt-l2cap.c */
 /* bt-l2cap.c */
 struct bt_l2cap_device_s;
 struct bt_l2cap_device_s;

+ 1 - 1
include/hw/char/cadence_uart.h

@@ -51,7 +51,7 @@ typedef struct {
 
 
 static inline DeviceState *cadence_uart_create(hwaddr addr,
 static inline DeviceState *cadence_uart_create(hwaddr addr,
                                         qemu_irq irq,
                                         qemu_irq irq,
-                                        CharDriverState *chr)
+                                        Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     SysBusDevice *s;
     SysBusDevice *s;

+ 1 - 1
include/hw/char/escc.h

@@ -5,7 +5,7 @@
 #define TYPE_ESCC "escc"
 #define TYPE_ESCC "escc"
 #define ESCC_SIZE 4
 #define ESCC_SIZE 4
 MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB,
 MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB,
-              CharDriverState *chrA, CharDriverState *chrB,
+              Chardev *chrA, Chardev *chrB,
               int clock, int it_shift);
               int clock, int it_shift);
 
 
 void slavio_serial_ms_kbd_init(hwaddr base, qemu_irq irq,
 void slavio_serial_ms_kbd_init(hwaddr base, qemu_irq irq,

+ 2 - 2
include/hw/char/pl011.h

@@ -17,7 +17,7 @@
 
 
 static inline DeviceState *pl011_create(hwaddr addr,
 static inline DeviceState *pl011_create(hwaddr addr,
                                         qemu_irq irq,
                                         qemu_irq irq,
-                                        CharDriverState *chr)
+                                        Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     SysBusDevice *s;
     SysBusDevice *s;
@@ -34,7 +34,7 @@ static inline DeviceState *pl011_create(hwaddr addr,
 
 
 static inline DeviceState *pl011_luminary_create(hwaddr addr,
 static inline DeviceState *pl011_luminary_create(hwaddr addr,
                                                  qemu_irq irq,
                                                  qemu_irq irq,
-                                                 CharDriverState *chr)
+                                                 Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     SysBusDevice *s;
     SysBusDevice *s;

+ 2 - 2
include/hw/char/serial.h

@@ -88,11 +88,11 @@ void serial_set_frequency(SerialState *s, uint32_t frequency);
 
 
 /* legacy pre qom */
 /* legacy pre qom */
 SerialState *serial_init(int base, qemu_irq irq, int baudbase,
 SerialState *serial_init(int base, qemu_irq irq, int baudbase,
-                         CharDriverState *chr, MemoryRegion *system_io);
+                         Chardev *chr, MemoryRegion *system_io);
 SerialState *serial_mm_init(MemoryRegion *address_space,
 SerialState *serial_mm_init(MemoryRegion *address_space,
                             hwaddr base, int it_shift,
                             hwaddr base, int it_shift,
                             qemu_irq irq, int baudbase,
                             qemu_irq irq, int baudbase,
-                            CharDriverState *chr, enum device_endian end);
+                            Chardev *chr, enum device_endian end);
 
 
 /* serial-isa.c */
 /* serial-isa.c */
 #define TYPE_ISA_SERIAL "isa-serial"
 #define TYPE_ISA_SERIAL "isa-serial"

+ 1 - 1
include/hw/char/xilinx_uartlite.h

@@ -17,7 +17,7 @@
 
 
 static inline DeviceState *xilinx_uartlite_create(hwaddr addr,
 static inline DeviceState *xilinx_uartlite_create(hwaddr addr,
                                         qemu_irq irq,
                                         qemu_irq irq,
-                                        CharDriverState *chr)
+                                        Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     SysBusDevice *s;
     SysBusDevice *s;

+ 1 - 1
include/hw/cris/etraxfs.h

@@ -48,7 +48,7 @@ etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr,
 
 
 static inline DeviceState *etraxfs_ser_create(hwaddr addr,
 static inline DeviceState *etraxfs_ser_create(hwaddr addr,
                                               qemu_irq irq,
                                               qemu_irq irq,
-                                              CharDriverState *chr)
+                                              Chardev *chr)
 {
 {
     DeviceState *dev;
     DeviceState *dev;
     SysBusDevice *s;
     SysBusDevice *s;

+ 1 - 1
include/hw/devices.h

@@ -65,6 +65,6 @@ qemu_irq tc6393xb_l3v_get(TC6393xbState *s);
 /* sm501.c */
 /* sm501.c */
 void sm501_init(struct MemoryRegion *address_space_mem, uint32_t base,
 void sm501_init(struct MemoryRegion *address_space_mem, uint32_t base,
                 uint32_t local_mem_bytes, qemu_irq irq,
                 uint32_t local_mem_bytes, qemu_irq irq,
-                CharDriverState *chr);
+                Chardev *chr);
 
 
 #endif
 #endif

+ 1 - 1
include/hw/i386/pc.h

@@ -181,7 +181,7 @@ void parallel_hds_isa_init(ISABus *bus, int n);
 
 
 bool parallel_mm_init(MemoryRegion *address_space,
 bool parallel_mm_init(MemoryRegion *address_space,
                       hwaddr base, int it_shift, qemu_irq irq,
                       hwaddr base, int it_shift, qemu_irq irq,
-                      CharDriverState *chr);
+                      Chardev *chr);
 
 
 /* i8259.c */
 /* i8259.c */
 
 

+ 2 - 2
include/hw/m68k/mcf.h

@@ -11,10 +11,10 @@ uint64_t mcf_uart_read(void *opaque, hwaddr addr,
                        unsigned size);
                        unsigned size);
 void mcf_uart_write(void *opaque, hwaddr addr,
 void mcf_uart_write(void *opaque, hwaddr addr,
                     uint64_t val, unsigned size);
                     uint64_t val, unsigned size);
-void *mcf_uart_init(qemu_irq irq, CharDriverState *chr);
+void *mcf_uart_init(qemu_irq irq, Chardev *chr);
 void mcf_uart_mm_init(struct MemoryRegion *sysmem,
 void mcf_uart_mm_init(struct MemoryRegion *sysmem,
                       hwaddr base,
                       hwaddr base,
-                      qemu_irq irq, CharDriverState *chr);
+                      qemu_irq irq, Chardev *chr);
 
 
 /* mcf_intc.c */
 /* mcf_intc.c */
 qemu_irq *mcf_intc_init(struct MemoryRegion *sysmem,
 qemu_irq *mcf_intc_init(struct MemoryRegion *sysmem,

+ 1 - 1
include/hw/ppc/spapr_vio.h

@@ -127,7 +127,7 @@ int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq);
 
 
 VIOsPAPRDevice *vty_lookup(sPAPRMachineState *spapr, target_ulong reg);
 VIOsPAPRDevice *vty_lookup(sPAPRMachineState *spapr, target_ulong reg);
 void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len);
 void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len);
-void spapr_vty_create(VIOsPAPRBus *bus, CharDriverState *chardev);
+void spapr_vty_create(VIOsPAPRBus *bus, Chardev *chardev);
 void spapr_vlan_create(VIOsPAPRBus *bus, NICInfo *nd);
 void spapr_vlan_create(VIOsPAPRBus *bus, NICInfo *nd);
 void spapr_vscsi_create(VIOsPAPRBus *bus);
 void spapr_vscsi_create(VIOsPAPRBus *bus);
 
 

+ 1 - 1
include/hw/qdev-properties.h

@@ -184,7 +184,7 @@ void qdev_prop_set_uint32(DeviceState *dev, const char *name, uint32_t value);
 void qdev_prop_set_int32(DeviceState *dev, const char *name, int32_t value);
 void qdev_prop_set_int32(DeviceState *dev, const char *name, int32_t value);
 void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value);
 void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value);
 void qdev_prop_set_string(DeviceState *dev, const char *name, const char *value);
 void qdev_prop_set_string(DeviceState *dev, const char *name, const char *value);
-void qdev_prop_set_chr(DeviceState *dev, const char *name, CharDriverState *value);
+void qdev_prop_set_chr(DeviceState *dev, const char *name, Chardev *value);
 void qdev_prop_set_netdev(DeviceState *dev, const char *name, NetClientState *value);
 void qdev_prop_set_netdev(DeviceState *dev, const char *name, NetClientState *value);
 void qdev_prop_set_drive(DeviceState *dev, const char *name,
 void qdev_prop_set_drive(DeviceState *dev, const char *name,
                          BlockBackend *value, Error **errp);
                          BlockBackend *value, Error **errp);

+ 1 - 1
include/hw/sh4/sh.h

@@ -42,7 +42,7 @@ void tmu012_init(struct MemoryRegion *sysmem, hwaddr base,
 #define SH_SERIAL_FEAT_SCIF (1 << 0)
 #define SH_SERIAL_FEAT_SCIF (1 << 0)
 void sh_serial_init(MemoryRegion *sysmem,
 void sh_serial_init(MemoryRegion *sysmem,
                     hwaddr base, int feat,
                     hwaddr base, int feat,
-		     uint32_t freq, CharDriverState *chr,
+                    uint32_t freq, Chardev *chr,
 		     qemu_irq eri_source,
 		     qemu_irq eri_source,
 		     qemu_irq rxi_source,
 		     qemu_irq rxi_source,
 		     qemu_irq txi_source,
 		     qemu_irq txi_source,

+ 1 - 1
include/hw/sparc/grlib.h

@@ -100,7 +100,7 @@ DeviceState *grlib_gptimer_create(hwaddr  base,
 
 
 static inline
 static inline
 DeviceState *grlib_apbuart_create(hwaddr  base,
 DeviceState *grlib_apbuart_create(hwaddr  base,
-                                  CharDriverState    *serial,
+                                  Chardev    *serial,
                                   qemu_irq            irq)
                                   qemu_irq            irq)
 {
 {
     DeviceState *dev;
     DeviceState *dev;

+ 1 - 1
include/hw/xen/xen.h

@@ -37,7 +37,7 @@ int xen_is_pirq_msi(uint32_t msi_data);
 
 
 qemu_irq *xen_interrupt_controller_init(void);
 qemu_irq *xen_interrupt_controller_init(void);
 
 
-void xenstore_store_pv_console_info(int i, struct CharDriverState *chr);
+void xenstore_store_pv_console_info(int i, struct Chardev *chr);
 
 
 void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory);
 void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory);
 
 

+ 1 - 1
include/monitor/monitor.h

@@ -16,7 +16,7 @@ extern Monitor *cur_mon;
 
 
 bool monitor_cur_is_qmp(void);
 bool monitor_cur_is_qmp(void);
 
 
-void monitor_init(CharDriverState *chr, int flags);
+void monitor_init(Chardev *chr, int flags);
 void monitor_cleanup(void);
 void monitor_cleanup(void);
 
 
 int monitor_suspend(Monitor *mon);
 int monitor_suspend(Monitor *mon);

+ 1 - 1
include/qemu/typedefs.h

@@ -17,7 +17,7 @@ typedef struct BlockBackendRootState BlockBackendRootState;
 typedef struct BlockDriverState BlockDriverState;
 typedef struct BlockDriverState BlockDriverState;
 typedef struct BusClass BusClass;
 typedef struct BusClass BusClass;
 typedef struct BusState BusState;
 typedef struct BusState BusState;
-typedef struct CharDriverState CharDriverState;
+typedef struct Chardev Chardev;
 typedef struct CompatProperty CompatProperty;
 typedef struct CompatProperty CompatProperty;
 typedef struct CPUAddressSpace CPUAddressSpace;
 typedef struct CPUAddressSpace CPUAddressSpace;
 typedef struct CPUState CPUState;
 typedef struct CPUState CPUState;

+ 47 - 47
include/sysemu/char.h

@@ -76,9 +76,9 @@ typedef enum {
 } CharDriverFeature;
 } CharDriverFeature;
 
 
 /* This is the backend as seen by frontend, the actual backend is
 /* This is the backend as seen by frontend, the actual backend is
- * CharDriverState */
+ * Chardev */
 typedef struct CharBackend {
 typedef struct CharBackend {
-    CharDriverState *chr;
+    Chardev *chr;
     IOEventHandler *chr_event;
     IOEventHandler *chr_event;
     IOCanReadHandler *chr_can_read;
     IOCanReadHandler *chr_can_read;
     IOReadHandler *chr_read;
     IOReadHandler *chr_read;
@@ -89,7 +89,7 @@ typedef struct CharBackend {
 
 
 typedef struct CharDriver CharDriver;
 typedef struct CharDriver CharDriver;
 
 
-struct CharDriverState {
+struct Chardev {
     const CharDriver *driver;
     const CharDriver *driver;
     QemuMutex chr_write_lock;
     QemuMutex chr_write_lock;
     CharBackend *be;
     CharBackend *be;
@@ -99,7 +99,7 @@ struct CharDriverState {
     int be_open;
     int be_open;
     guint fd_in_tag;
     guint fd_in_tag;
     DECLARE_BITMAP(features, QEMU_CHAR_FEATURE_LAST);
     DECLARE_BITMAP(features, QEMU_CHAR_FEATURE_LAST);
-    QTAILQ_ENTRY(CharDriverState) next;
+    QTAILQ_ENTRY(Chardev) next;
 };
 };
 
 
 /**
 /**
@@ -107,12 +107,12 @@ struct CharDriverState {
  * @backend: the common backend config
  * @backend: the common backend config
  * @errp: pointer to a NULL-initialized error object
  * @errp: pointer to a NULL-initialized error object
  *
  *
- * Allocate and initialize a new CharDriverState.
+ * Allocate and initialize a new Chardev.
  *
  *
- * Returns: a newly allocated CharDriverState, or NULL on error.
+ * Returns: a newly allocated Chardev, or NULL on error.
  */
  */
-CharDriverState *qemu_chr_alloc(const CharDriver *driver,
-                                ChardevCommon *backend, Error **errp);
+Chardev *qemu_chr_alloc(const CharDriver *driver,
+                        ChardevCommon *backend, Error **errp);
 
 
 /**
 /**
  * @qemu_chr_new_from_opts:
  * @qemu_chr_new_from_opts:
@@ -123,8 +123,8 @@ CharDriverState *qemu_chr_alloc(const CharDriver *driver,
  *
  *
  * Returns: a new character backend
  * Returns: a new character backend
  */
  */
-CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts,
-                                        Error **errp);
+Chardev *qemu_chr_new_from_opts(QemuOpts *opts,
+                                Error **errp);
 
 
 /**
 /**
  * @qemu_chr_parse_common:
  * @qemu_chr_parse_common:
@@ -146,7 +146,7 @@ void qemu_chr_parse_common(QemuOpts *opts, ChardevCommon *backend);
  *
  *
  * Returns: a new character backend
  * Returns: a new character backend
  */
  */
-CharDriverState *qemu_chr_new(const char *label, const char *filename);
+Chardev *qemu_chr_new(const char *label, const char *filename);
 
 
 
 
 /**
 /**
@@ -184,7 +184,7 @@ int qemu_chr_fe_wait_connected(CharBackend *be, Error **errp);
  *
  *
  * Returns: a new character backend
  * Returns: a new character backend
  */
  */
-CharDriverState *qemu_chr_new_noreplay(const char *label, const char *filename);
+Chardev *qemu_chr_new_noreplay(const char *label, const char *filename);
 
 
 /**
 /**
  * @qemu_chr_delete:
  * @qemu_chr_delete:
@@ -192,14 +192,14 @@ CharDriverState *qemu_chr_new_noreplay(const char *label, const char *filename);
  * Destroy a character backend and remove it from the list of
  * Destroy a character backend and remove it from the list of
  * identified character backends.
  * identified character backends.
  */
  */
-void qemu_chr_delete(CharDriverState *chr);
+void qemu_chr_delete(Chardev *chr);
 
 
 /**
 /**
  * @qemu_chr_free:
  * @qemu_chr_free:
  *
  *
  * Destroy a character backend.
  * Destroy a character backend.
  */
  */
-void qemu_chr_free(CharDriverState *chr);
+void qemu_chr_free(Chardev *chr);
 
 
 /**
 /**
  * @qemu_chr_fe_set_echo:
  * @qemu_chr_fe_set_echo:
@@ -355,7 +355,7 @@ int qemu_chr_fe_set_msgfds(CharBackend *be, int *fds, int num);
  *
  *
  * Returns: the number of bytes the front end can receive via @qemu_chr_be_write
  * Returns: the number of bytes the front end can receive via @qemu_chr_be_write
  */
  */
-int qemu_chr_be_can_write(CharDriverState *s);
+int qemu_chr_be_can_write(Chardev *s);
 
 
 /**
 /**
  * @qemu_chr_be_write:
  * @qemu_chr_be_write:
@@ -367,7 +367,7 @@ int qemu_chr_be_can_write(CharDriverState *s);
  * @buf a buffer to receive data from the front end
  * @buf a buffer to receive data from the front end
  * @len the number of bytes to receive from the front end
  * @len the number of bytes to receive from the front end
  */
  */
-void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len);
+void qemu_chr_be_write(Chardev *s, uint8_t *buf, int len);
 
 
 /**
 /**
  * @qemu_chr_be_write_impl:
  * @qemu_chr_be_write_impl:
@@ -377,7 +377,7 @@ void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len);
  * @buf a buffer to receive data from the front end
  * @buf a buffer to receive data from the front end
  * @len the number of bytes to receive from the front end
  * @len the number of bytes to receive from the front end
  */
  */
-void qemu_chr_be_write_impl(CharDriverState *s, uint8_t *buf, int len);
+void qemu_chr_be_write_impl(Chardev *s, uint8_t *buf, int len);
 
 
 /**
 /**
  * @qemu_chr_be_event:
  * @qemu_chr_be_event:
@@ -386,7 +386,7 @@ void qemu_chr_be_write_impl(CharDriverState *s, uint8_t *buf, int len);
  *
  *
  * @event the event to send
  * @event the event to send
  */
  */
-void qemu_chr_be_event(CharDriverState *s, int event);
+void qemu_chr_be_event(Chardev *s, int event);
 
 
 /**
 /**
  * @qemu_chr_fe_init:
  * @qemu_chr_fe_init:
@@ -397,7 +397,7 @@ void qemu_chr_be_event(CharDriverState *s, int event);
  *
  *
  * Returns: false on error.
  * Returns: false on error.
  */
  */
-bool qemu_chr_fe_init(CharBackend *b, CharDriverState *s, Error **errp);
+bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp);
 
 
 /**
 /**
  * @qemu_chr_fe_get_driver:
  * @qemu_chr_fe_get_driver:
@@ -405,7 +405,7 @@ bool qemu_chr_fe_init(CharBackend *b, CharDriverState *s, Error **errp);
  * Returns the driver associated with a CharBackend or NULL if no
  * Returns the driver associated with a CharBackend or NULL if no
  * associated CharDriver.
  * associated CharDriver.
  */
  */
-CharDriverState *qemu_chr_fe_get_driver(CharBackend *be);
+Chardev *qemu_chr_fe_get_driver(CharBackend *be);
 
 
 /**
 /**
  * @qemu_chr_fe_deinit:
  * @qemu_chr_fe_deinit:
@@ -450,27 +450,27 @@ void qemu_chr_fe_set_handlers(CharBackend *b,
  */
  */
 void qemu_chr_fe_take_focus(CharBackend *b);
 void qemu_chr_fe_take_focus(CharBackend *b);
 
 
-void qemu_chr_be_generic_open(CharDriverState *s);
+void qemu_chr_be_generic_open(Chardev *s);
 void qemu_chr_fe_accept_input(CharBackend *be);
 void qemu_chr_fe_accept_input(CharBackend *be);
-int qemu_chr_add_client(CharDriverState *s, int fd);
-CharDriverState *qemu_chr_find(const char *name);
+int qemu_chr_add_client(Chardev *s, int fd);
+Chardev *qemu_chr_find(const char *name);
 
 
 /**
 /**
  * @qemu_chr_get_kind:
  * @qemu_chr_get_kind:
  *
  *
  * Returns the kind of char backend, or -1 if unspecified.
  * Returns the kind of char backend, or -1 if unspecified.
  */
  */
-ChardevBackendKind qemu_chr_get_kind(const CharDriverState *chr);
+ChardevBackendKind qemu_chr_get_kind(const Chardev *chr);
 
 
-static inline bool qemu_chr_is_ringbuf(const CharDriverState *chr)
+static inline bool qemu_chr_is_ringbuf(const Chardev *chr)
 {
 {
     return qemu_chr_get_kind(chr) == CHARDEV_BACKEND_KIND_RINGBUF ||
     return qemu_chr_get_kind(chr) == CHARDEV_BACKEND_KIND_RINGBUF ||
         qemu_chr_get_kind(chr) == CHARDEV_BACKEND_KIND_MEMORY;
         qemu_chr_get_kind(chr) == CHARDEV_BACKEND_KIND_MEMORY;
 }
 }
 
 
-bool qemu_chr_has_feature(CharDriverState *chr,
+bool qemu_chr_has_feature(Chardev *chr,
                           CharDriverFeature feature);
                           CharDriverFeature feature);
-void qemu_chr_set_feature(CharDriverState *chr,
+void qemu_chr_set_feature(Chardev *chr,
                           CharDriverFeature feature);
                           CharDriverFeature feature);
 QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename);
 QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename);
 
 
@@ -478,29 +478,29 @@ struct CharDriver {
     ChardevBackendKind kind;
     ChardevBackendKind kind;
     const char *alias;
     const char *alias;
     void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp);
     void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp);
-    CharDriverState *(*create)(const CharDriver *driver,
-                               const char *id,
-                               ChardevBackend *backend,
-                               ChardevReturn *ret, bool *be_opened,
-                               Error **errp);
+    Chardev *(*create)(const CharDriver *driver,
+                       const char *id,
+                       ChardevBackend *backend,
+                       ChardevReturn *ret, bool *be_opened,
+                       Error **errp);
     size_t instance_size;
     size_t instance_size;
 
 
-    int (*chr_write)(struct CharDriverState *s, const uint8_t *buf, int len);
-    int (*chr_sync_read)(struct CharDriverState *s,
+    int (*chr_write)(struct Chardev *s, const uint8_t *buf, int len);
+    int (*chr_sync_read)(struct Chardev *s,
                          const uint8_t *buf, int len);
                          const uint8_t *buf, int len);
-    GSource *(*chr_add_watch)(struct CharDriverState *s, GIOCondition cond);
-    void (*chr_update_read_handler)(struct CharDriverState *s,
+    GSource *(*chr_add_watch)(struct Chardev *s, GIOCondition cond);
+    void (*chr_update_read_handler)(struct Chardev *s,
                                     GMainContext *context);
                                     GMainContext *context);
-    int (*chr_ioctl)(struct CharDriverState *s, int cmd, void *arg);
-    int (*get_msgfds)(struct CharDriverState *s, int* fds, int num);
-    int (*set_msgfds)(struct CharDriverState *s, int *fds, int num);
-    int (*chr_add_client)(struct CharDriverState *chr, int fd);
-    int (*chr_wait_connected)(struct CharDriverState *chr, Error **errp);
-    void (*chr_free)(struct CharDriverState *chr);
-    void (*chr_disconnect)(struct CharDriverState *chr);
-    void (*chr_accept_input)(struct CharDriverState *chr);
-    void (*chr_set_echo)(struct CharDriverState *chr, bool echo);
-    void (*chr_set_fe_open)(struct CharDriverState *chr, int fe_open);
+    int (*chr_ioctl)(struct Chardev *s, int cmd, void *arg);
+    int (*get_msgfds)(struct Chardev *s, int* fds, int num);
+    int (*set_msgfds)(struct Chardev *s, int *fds, int num);
+    int (*chr_add_client)(struct Chardev *chr, int fd);
+    int (*chr_wait_connected)(struct Chardev *chr, Error **errp);
+    void (*chr_free)(struct Chardev *chr);
+    void (*chr_disconnect)(struct Chardev *chr);
+    void (*chr_accept_input)(struct Chardev *chr);
+    void (*chr_set_echo)(struct Chardev *chr, bool echo);
+    void (*chr_set_fe_open)(struct Chardev *chr, int fe_open);
 };
 };
 
 
 void register_char_driver(const CharDriver *driver);
 void register_char_driver(const CharDriver *driver);
@@ -509,7 +509,7 @@ extern int term_escape_char;
 
 
 
 
 /* console.c */
 /* console.c */
-typedef CharDriverState *(VcHandler)(ChardevVC *vc, Error **errp);
+typedef Chardev *(VcHandler)(ChardevVC *vc, Error **errp);
 void register_vc_handler(VcHandler *handler);
 void register_vc_handler(VcHandler *handler);
 
 
 #endif
 #endif

+ 2 - 2
include/sysemu/replay.h

@@ -128,9 +128,9 @@ uint64_t blkreplay_next_id(void);
 /* Character device */
 /* Character device */
 
 
 /*! Registers char driver to save it's events */
 /*! Registers char driver to save it's events */
-void replay_register_char_driver(struct CharDriverState *chr);
+void replay_register_char_driver(struct Chardev *chr);
 /*! Saves write to char device event to the log */
 /*! Saves write to char device event to the log */
-void replay_chr_be_write(struct CharDriverState *s, uint8_t *buf, int len);
+void replay_chr_be_write(struct Chardev *s, uint8_t *buf, int len);
 /*! Writes char write return value to the replay log. */
 /*! Writes char write return value to the replay log. */
 void replay_char_write_event_save(int res, int offset);
 void replay_char_write_event_save(int res, int offset);
 /*! Reads char write return value from the replay log. */
 /*! Reads char write return value from the replay log. */

+ 2 - 2
include/sysemu/sysemu.h

@@ -190,13 +190,13 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict);
 
 
 #define MAX_SERIAL_PORTS 4
 #define MAX_SERIAL_PORTS 4
 
 
-extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
+extern Chardev *serial_hds[MAX_SERIAL_PORTS];
 
 
 /* parallel ports */
 /* parallel ports */
 
 
 #define MAX_PARALLEL_PORTS 3
 #define MAX_PARALLEL_PORTS 3
 
 
-extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
+extern Chardev *parallel_hds[MAX_PARALLEL_PORTS];
 
 
 void hmp_usb_add(Monitor *mon, const QDict *qdict);
 void hmp_usb_add(Monitor *mon, const QDict *qdict);
 void hmp_usb_del(Monitor *mon, const QDict *qdict);
 void hmp_usb_del(Monitor *mon, const QDict *qdict);

+ 1 - 1
include/ui/gtk.h

@@ -64,7 +64,7 @@ typedef struct VirtualVteConsole {
     GtkWidget *box;
     GtkWidget *box;
     GtkWidget *scrollbar;
     GtkWidget *scrollbar;
     GtkWidget *terminal;
     GtkWidget *terminal;
-    CharDriverState *chr;
+    Chardev *chr;
     bool echo;
     bool echo;
 } VirtualVteConsole;
 } VirtualVteConsole;
 #endif
 #endif

+ 1 - 1
include/ui/qemu-spice.h

@@ -51,7 +51,7 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
 #if SPICE_SERVER_VERSION >= 0x000c02
 #if SPICE_SERVER_VERSION >= 0x000c02
 void qemu_spice_register_ports(void);
 void qemu_spice_register_ports(void);
 #else
 #else
-static inline CharDriverState *qemu_chr_open_spice_port(const char *name)
+static inline Chardev *qemu_chr_open_spice_port(const char *name)
 { return NULL; }
 { return NULL; }
 #endif
 #endif
 
 

+ 2 - 2
monitor.c

@@ -3195,7 +3195,7 @@ static void ringbuf_completion(ReadLineState *rs, const char *str)
         ChardevInfo *chr_info = list->value;
         ChardevInfo *chr_info = list->value;
 
 
         if (!strncmp(chr_info->label, str, len)) {
         if (!strncmp(chr_info->label, str, len)) {
-            CharDriverState *chr = qemu_chr_find(chr_info->label);
+            Chardev *chr = qemu_chr_find(chr_info->label);
             if (chr && qemu_chr_is_ringbuf(chr)) {
             if (chr && qemu_chr_is_ringbuf(chr)) {
                 readline_add_completion(rs, chr_info->label);
                 readline_add_completion(rs, chr_info->label);
             }
             }
@@ -3985,7 +3985,7 @@ static void __attribute__((constructor)) monitor_lock_init(void)
     qemu_mutex_init(&monitor_lock);
     qemu_mutex_init(&monitor_lock);
 }
 }
 
 
-void monitor_init(CharDriverState *chr, int flags)
+void monitor_init(Chardev *chr, int flags)
 {
 {
     static int is_first_init = 1;
     static int is_first_init = 1;
     Monitor *mon;
     Monitor *mon;

+ 2 - 2
net/colo-compare.c

@@ -564,7 +564,7 @@ static void compare_sec_rs_finalize(SocketReadState *sec_rs)
  * Return 0 is success.
  * Return 0 is success.
  * Return 1 is failed.
  * Return 1 is failed.
  */
  */
-static int find_and_check_chardev(CharDriverState **chr,
+static int find_and_check_chardev(Chardev **chr,
                                   char *chr_name,
                                   char *chr_name,
                                   Error **errp)
                                   Error **errp)
 {
 {
@@ -611,7 +611,7 @@ static void check_old_packet_regular(void *opaque)
 static void colo_compare_complete(UserCreatable *uc, Error **errp)
 static void colo_compare_complete(UserCreatable *uc, Error **errp)
 {
 {
     CompareState *s = COLO_COMPARE(uc);
     CompareState *s = COLO_COMPARE(uc);
-    CharDriverState *chr;
+    Chardev *chr;
     char thread_name[64];
     char thread_name[64];
     static int compare_id;
     static int compare_id;
 
 

+ 2 - 2
net/filter-mirror.c

@@ -191,7 +191,7 @@ static void filter_redirector_cleanup(NetFilterState *nf)
 static void filter_mirror_setup(NetFilterState *nf, Error **errp)
 static void filter_mirror_setup(NetFilterState *nf, Error **errp)
 {
 {
     MirrorState *s = FILTER_MIRROR(nf);
     MirrorState *s = FILTER_MIRROR(nf);
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     if (!s->outdev) {
     if (!s->outdev) {
         error_setg(errp, "filter mirror needs 'outdev' "
         error_setg(errp, "filter mirror needs 'outdev' "
@@ -220,7 +220,7 @@ static void redirector_rs_finalize(SocketReadState *rs)
 static void filter_redirector_setup(NetFilterState *nf, Error **errp)
 static void filter_redirector_setup(NetFilterState *nf, Error **errp)
 {
 {
     MirrorState *s = FILTER_REDIRECTOR(nf);
     MirrorState *s = FILTER_REDIRECTOR(nf);
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     if (!s->indev && !s->outdev) {
     if (!s->indev && !s->outdev) {
         error_setg(errp, "filter redirector needs 'indev' or "
         error_setg(errp, "filter redirector needs 'indev' or "

+ 1 - 1
net/slirp.c

@@ -748,7 +748,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
         }
         }
     } else {
     } else {
         Error *err = NULL;
         Error *err = NULL;
-        CharDriverState *chr = qemu_chr_new(buf, p);
+        Chardev *chr = qemu_chr_new(buf, p);
 
 
         if (!chr) {
         if (!chr) {
             error_report("could not open guest forwarding device '%s'", buf);
             error_report("could not open guest forwarding device '%s'", buf);

+ 5 - 5
net/vhost-user.c

@@ -195,7 +195,7 @@ static void net_vhost_user_event(void *opaque, int event)
     const char *name = opaque;
     const char *name = opaque;
     NetClientState *ncs[MAX_QUEUE_NUM];
     NetClientState *ncs[MAX_QUEUE_NUM];
     VhostUserState *s;
     VhostUserState *s;
-    CharDriverState *chr;
+    Chardev *chr;
     Error *err = NULL;
     Error *err = NULL;
     int queues;
     int queues;
 
 
@@ -232,7 +232,7 @@ static void net_vhost_user_event(void *opaque, int event)
 }
 }
 
 
 static int net_vhost_user_init(NetClientState *peer, const char *device,
 static int net_vhost_user_init(NetClientState *peer, const char *device,
-                               const char *name, CharDriverState *chr,
+                               const char *name, Chardev *chr,
                                int queues)
                                int queues)
 {
 {
     Error *err = NULL;
     Error *err = NULL;
@@ -274,10 +274,10 @@ static int net_vhost_user_init(NetClientState *peer, const char *device,
     return 0;
     return 0;
 }
 }
 
 
-static CharDriverState *net_vhost_claim_chardev(
+static Chardev *net_vhost_claim_chardev(
     const NetdevVhostUserOptions *opts, Error **errp)
     const NetdevVhostUserOptions *opts, Error **errp)
 {
 {
-    CharDriverState *chr = qemu_chr_find(opts->chardev);
+    Chardev *chr = qemu_chr_find(opts->chardev);
 
 
     if (chr == NULL) {
     if (chr == NULL) {
         error_setg(errp, "chardev \"%s\" not found", opts->chardev);
         error_setg(errp, "chardev \"%s\" not found", opts->chardev);
@@ -324,7 +324,7 @@ int net_init_vhost_user(const Netdev *netdev, const char *name,
 {
 {
     int queues;
     int queues;
     const NetdevVhostUserOptions *vhost_user_opts;
     const NetdevVhostUserOptions *vhost_user_opts;
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     assert(netdev->type == NET_CLIENT_DRIVER_VHOST_USER);
     assert(netdev->type == NET_CLIENT_DRIVER_VHOST_USER);
     vhost_user_opts = &netdev->u.vhost_user;
     vhost_user_opts = &netdev->u.vhost_user;

File diff suppressed because it is too large
+ 189 - 188
qemu-char.c


+ 1 - 1
qmp.c

@@ -616,7 +616,7 @@ void qmp_add_client(const char *protocol, const char *fdname,
                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,
                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,
                     Error **errp)
                     Error **errp)
 {
 {
-    CharDriverState *s;
+    Chardev *s;
     int fd;
     int fd;
 
 
     fd = monitor_get_fd(cur_mon, fdname, errp);
     fd = monitor_get_fd(cur_mon, fdname, errp);

+ 1 - 1
qtest.c

@@ -670,7 +670,7 @@ static int qtest_init_accel(MachineState *ms)
 
 
 void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
 void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
 {
 {
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     chr = qemu_chr_new("qtest", qtest_chrdev);
     chr = qemu_chr_new("qtest", qtest_chrdev);
 
 

+ 4 - 4
replay/replay-char.c

@@ -18,7 +18,7 @@
 
 
 /* Char drivers that generate qemu_chr_be_write events
 /* Char drivers that generate qemu_chr_be_write events
    that should be saved into the log. */
    that should be saved into the log. */
-static CharDriverState **char_drivers;
+static Chardev **char_drivers;
 static int drivers_count;
 static int drivers_count;
 
 
 /* Char event attributes. */
 /* Char event attributes. */
@@ -28,7 +28,7 @@ typedef struct CharEvent {
     size_t len;
     size_t len;
 } CharEvent;
 } CharEvent;
 
 
-static int find_char_driver(CharDriverState *chr)
+static int find_char_driver(Chardev *chr)
 {
 {
     int i = 0;
     int i = 0;
     for ( ; i < drivers_count ; ++i) {
     for ( ; i < drivers_count ; ++i) {
@@ -39,7 +39,7 @@ static int find_char_driver(CharDriverState *chr)
     return -1;
     return -1;
 }
 }
 
 
-void replay_register_char_driver(CharDriverState *chr)
+void replay_register_char_driver(Chardev *chr)
 {
 {
     if (replay_mode == REPLAY_MODE_NONE) {
     if (replay_mode == REPLAY_MODE_NONE) {
         return;
         return;
@@ -49,7 +49,7 @@ void replay_register_char_driver(CharDriverState *chr)
     char_drivers[drivers_count++] = chr;
     char_drivers[drivers_count++] = chr;
 }
 }
 
 
-void replay_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
+void replay_chr_be_write(Chardev *s, uint8_t *buf, int len)
 {
 {
     CharEvent *event = g_malloc0(sizeof(CharEvent));
     CharEvent *event = g_malloc0(sizeof(CharEvent));
 
 

+ 40 - 40
spice-qemu-char.c

@@ -6,29 +6,29 @@
 #include <spice/protocol.h>
 #include <spice/protocol.h>
 
 
 
 
-typedef struct SpiceCharDriver {
-    CharDriverState       parent;
+typedef struct SpiceChardev {
+    Chardev               parent;
 
 
-    SpiceCharDeviceInstance     sin;
+    SpiceCharDeviceInstance sin;
     bool                  active;
     bool                  active;
     bool                  blocked;
     bool                  blocked;
     const uint8_t         *datapos;
     const uint8_t         *datapos;
     int                   datalen;
     int                   datalen;
-    QLIST_ENTRY(SpiceCharDriver) next;
-} SpiceCharDriver;
+    QLIST_ENTRY(SpiceChardev) next;
+} SpiceChardev;
 
 
 typedef struct SpiceCharSource {
 typedef struct SpiceCharSource {
     GSource               source;
     GSource               source;
-    SpiceCharDriver       *scd;
+    SpiceChardev       *scd;
 } SpiceCharSource;
 } SpiceCharSource;
 
 
-static QLIST_HEAD(, SpiceCharDriver) spice_chars =
+static QLIST_HEAD(, SpiceChardev) spice_chars =
     QLIST_HEAD_INITIALIZER(spice_chars);
     QLIST_HEAD_INITIALIZER(spice_chars);
 
 
 static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
 static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
 {
 {
-    SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin);
-    CharDriverState *chr = (CharDriverState *)scd;
+    SpiceChardev *scd = container_of(sin, SpiceChardev, sin);
+    Chardev *chr = (Chardev *)scd;
     ssize_t out = 0;
     ssize_t out = 0;
     ssize_t last_out;
     ssize_t last_out;
     uint8_t* p = (uint8_t*)buf;
     uint8_t* p = (uint8_t*)buf;
@@ -51,7 +51,7 @@ static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
 
 
 static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
 static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
 {
 {
-    SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin);
+    SpiceChardev *scd = container_of(sin, SpiceChardev, sin);
     int bytes = MIN(len, scd->datalen);
     int bytes = MIN(len, scd->datalen);
 
 
     if (bytes > 0) {
     if (bytes > 0) {
@@ -71,8 +71,8 @@ static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
 #if SPICE_SERVER_VERSION >= 0x000c02
 #if SPICE_SERVER_VERSION >= 0x000c02
 static void vmc_event(SpiceCharDeviceInstance *sin, uint8_t event)
 static void vmc_event(SpiceCharDeviceInstance *sin, uint8_t event)
 {
 {
-    SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin);
-    CharDriverState *chr = (CharDriverState *)scd;
+    SpiceChardev *scd = container_of(sin, SpiceChardev, sin);
+    Chardev *chr = (Chardev *)scd;
     int chr_event;
     int chr_event;
 
 
     switch (event) {
     switch (event) {
@@ -90,8 +90,8 @@ static void vmc_event(SpiceCharDeviceInstance *sin, uint8_t event)
 
 
 static void vmc_state(SpiceCharDeviceInstance *sin, int connected)
 static void vmc_state(SpiceCharDeviceInstance *sin, int connected)
 {
 {
-    SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin);
-    CharDriverState *chr = (CharDriverState *)scd;
+    SpiceChardev *scd = container_of(sin, SpiceChardev, sin);
+    Chardev *chr = (Chardev *)scd;
 
 
     if ((chr->be_open && connected) ||
     if ((chr->be_open && connected) ||
         (!chr->be_open && !connected)) {
         (!chr->be_open && !connected)) {
@@ -119,7 +119,7 @@ static SpiceCharDeviceInterface vmc_interface = {
 };
 };
 
 
 
 
-static void vmc_register_interface(SpiceCharDriver *scd)
+static void vmc_register_interface(SpiceChardev *scd)
 {
 {
     if (scd->active) {
     if (scd->active) {
         return;
         return;
@@ -130,7 +130,7 @@ static void vmc_register_interface(SpiceCharDriver *scd)
     trace_spice_vmc_register_interface(scd);
     trace_spice_vmc_register_interface(scd);
 }
 }
 
 
-static void vmc_unregister_interface(SpiceCharDriver *scd)
+static void vmc_unregister_interface(SpiceChardev *scd)
 {
 {
     if (!scd->active) {
     if (!scd->active) {
         return;
         return;
@@ -170,9 +170,9 @@ static GSourceFuncs SpiceCharSourceFuncs = {
     .dispatch = spice_char_source_dispatch,
     .dispatch = spice_char_source_dispatch,
 };
 };
 
 
-static GSource *spice_chr_add_watch(CharDriverState *chr, GIOCondition cond)
+static GSource *spice_chr_add_watch(Chardev *chr, GIOCondition cond)
 {
 {
-    SpiceCharDriver *scd = (SpiceCharDriver *)chr;
+    SpiceChardev *scd = (SpiceChardev *)chr;
     SpiceCharSource *src;
     SpiceCharSource *src;
 
 
     assert(cond & G_IO_OUT);
     assert(cond & G_IO_OUT);
@@ -184,9 +184,9 @@ static GSource *spice_chr_add_watch(CharDriverState *chr, GIOCondition cond)
     return (GSource *)src;
     return (GSource *)src;
 }
 }
 
 
-static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
+static int spice_chr_write(Chardev *chr, const uint8_t *buf, int len)
 {
 {
-    SpiceCharDriver *s = (SpiceCharDriver *)chr;
+    SpiceChardev *s = (SpiceChardev *)chr;
     int read_bytes;
     int read_bytes;
 
 
     assert(s->datalen == 0);
     assert(s->datalen == 0);
@@ -203,9 +203,9 @@ static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
     return read_bytes;
     return read_bytes;
 }
 }
 
 
-static void spice_chr_free(struct CharDriverState *chr)
+static void spice_chr_free(struct Chardev *chr)
 {
 {
-    SpiceCharDriver *s = (SpiceCharDriver *)chr;
+    SpiceChardev *s = (SpiceChardev *)chr;
 
 
     vmc_unregister_interface(s);
     vmc_unregister_interface(s);
     QLIST_REMOVE(s, next);
     QLIST_REMOVE(s, next);
@@ -216,9 +216,9 @@ static void spice_chr_free(struct CharDriverState *chr)
 #endif
 #endif
 }
 }
 
 
-static void spice_vmc_set_fe_open(struct CharDriverState *chr, int fe_open)
+static void spice_vmc_set_fe_open(struct Chardev *chr, int fe_open)
 {
 {
-    SpiceCharDriver *s = (SpiceCharDriver *)chr;
+    SpiceChardev *s = (SpiceChardev *)chr;
     if (fe_open) {
     if (fe_open) {
         vmc_register_interface(s);
         vmc_register_interface(s);
     } else {
     } else {
@@ -226,10 +226,10 @@ static void spice_vmc_set_fe_open(struct CharDriverState *chr, int fe_open)
     }
     }
 }
 }
 
 
-static void spice_port_set_fe_open(struct CharDriverState *chr, int fe_open)
+static void spice_port_set_fe_open(struct Chardev *chr, int fe_open)
 {
 {
 #if SPICE_SERVER_VERSION >= 0x000c02
 #if SPICE_SERVER_VERSION >= 0x000c02
-    SpiceCharDriver *s = (SpiceCharDriver *)chr;
+    SpiceChardev *s = (SpiceChardev *)chr;
 
 
     if (fe_open) {
     if (fe_open) {
         spice_server_port_event(&s->sin, SPICE_PORT_EVENT_OPENED);
         spice_server_port_event(&s->sin, SPICE_PORT_EVENT_OPENED);
@@ -256,26 +256,26 @@ static void print_allowed_subtypes(void)
     fprintf(stderr, "\n");
     fprintf(stderr, "\n");
 }
 }
 
 
-static void spice_chr_accept_input(struct CharDriverState *chr)
+static void spice_chr_accept_input(struct Chardev *chr)
 {
 {
-    SpiceCharDriver *s = (SpiceCharDriver *)chr;
+    SpiceChardev *s = (SpiceChardev *)chr;
 
 
     spice_server_char_device_wakeup(&s->sin);
     spice_server_char_device_wakeup(&s->sin);
 }
 }
 
 
-static CharDriverState *chr_open(const CharDriver *driver,
+static Chardev *chr_open(const CharDriver *driver,
                                  const char *subtype,
                                  const char *subtype,
                                  ChardevCommon *backend,
                                  ChardevCommon *backend,
                                  Error **errp)
                                  Error **errp)
 {
 {
-    CharDriverState *chr;
-    SpiceCharDriver *s;
+    Chardev *chr;
+    SpiceChardev *s;
 
 
     chr = qemu_chr_alloc(driver, backend, errp);
     chr = qemu_chr_alloc(driver, backend, errp);
     if (!chr) {
     if (!chr) {
         return NULL;
         return NULL;
     }
     }
-    s = (SpiceCharDriver *)chr;
+    s = (SpiceChardev *)chr;
     s->active = false;
     s->active = false;
     s->sin.subtype = g_strdup(subtype);
     s->sin.subtype = g_strdup(subtype);
 
 
@@ -284,7 +284,7 @@ static CharDriverState *chr_open(const CharDriver *driver,
     return chr;
     return chr;
 }
 }
 
 
-static CharDriverState *qemu_chr_open_spice_vmc(const CharDriver *driver,
+static Chardev *qemu_chr_open_spice_vmc(const CharDriver *driver,
                                                 const char *id,
                                                 const char *id,
                                                 ChardevBackend *backend,
                                                 ChardevBackend *backend,
                                                 ChardevReturn *ret,
                                                 ChardevReturn *ret,
@@ -312,7 +312,7 @@ static CharDriverState *qemu_chr_open_spice_vmc(const CharDriver *driver,
 }
 }
 
 
 #if SPICE_SERVER_VERSION >= 0x000c02
 #if SPICE_SERVER_VERSION >= 0x000c02
-static CharDriverState *qemu_chr_open_spice_port(const CharDriver *driver,
+static Chardev *qemu_chr_open_spice_port(const CharDriver *driver,
                                                  const char *id,
                                                  const char *id,
                                                  ChardevBackend *backend,
                                                  ChardevBackend *backend,
                                                  ChardevReturn *ret,
                                                  ChardevReturn *ret,
@@ -322,8 +322,8 @@ static CharDriverState *qemu_chr_open_spice_port(const CharDriver *driver,
     ChardevSpicePort *spiceport = backend->u.spiceport.data;
     ChardevSpicePort *spiceport = backend->u.spiceport.data;
     const char *name = spiceport->fqdn;
     const char *name = spiceport->fqdn;
     ChardevCommon *common = qapi_ChardevSpicePort_base(spiceport);
     ChardevCommon *common = qapi_ChardevSpicePort_base(spiceport);
-    CharDriverState *chr;
-    SpiceCharDriver *s;
+    Chardev *chr;
+    SpiceChardev *s;
 
 
     if (name == NULL) {
     if (name == NULL) {
         fprintf(stderr, "spice-qemu-char: missing name parameter\n");
         fprintf(stderr, "spice-qemu-char: missing name parameter\n");
@@ -335,7 +335,7 @@ static CharDriverState *qemu_chr_open_spice_port(const CharDriver *driver,
         return NULL;
         return NULL;
     }
     }
     *be_opened = false;
     *be_opened = false;
-    s = (SpiceCharDriver *)chr;
+    s = (SpiceChardev *)chr;
     s->sin.portname = g_strdup(name);
     s->sin.portname = g_strdup(name);
 
 
     return chr;
     return chr;
@@ -343,7 +343,7 @@ static CharDriverState *qemu_chr_open_spice_port(const CharDriver *driver,
 
 
 void qemu_spice_register_ports(void)
 void qemu_spice_register_ports(void)
 {
 {
-    SpiceCharDriver *s;
+    SpiceChardev *s;
 
 
     QLIST_FOREACH(s, &spice_chars, next) {
     QLIST_FOREACH(s, &spice_chars, next) {
         if (s->sin.portname == NULL) {
         if (s->sin.portname == NULL) {
@@ -387,7 +387,7 @@ static void qemu_chr_parse_spice_port(QemuOpts *opts, ChardevBackend *backend,
 static void register_types(void)
 static void register_types(void)
 {
 {
     static const CharDriver vmc_driver = {
     static const CharDriver vmc_driver = {
-        .instance_size = sizeof(SpiceCharDriver),
+        .instance_size = sizeof(SpiceChardev),
         .kind = CHARDEV_BACKEND_KIND_SPICEVMC,
         .kind = CHARDEV_BACKEND_KIND_SPICEVMC,
         .parse = qemu_chr_parse_spice_vmc,
         .parse = qemu_chr_parse_spice_vmc,
         .create = qemu_chr_open_spice_vmc,
         .create = qemu_chr_open_spice_vmc,
@@ -398,7 +398,7 @@ static void register_types(void)
         .chr_free = spice_chr_free,
         .chr_free = spice_chr_free,
     };
     };
     static const CharDriver port_driver = {
     static const CharDriver port_driver = {
-        .instance_size = sizeof(SpiceCharDriver),
+        .instance_size = sizeof(SpiceChardev),
         .kind = CHARDEV_BACKEND_KIND_SPICEPORT,
         .kind = CHARDEV_BACKEND_KIND_SPICEPORT,
         .parse = qemu_chr_parse_spice_port,
         .parse = qemu_chr_parse_spice_port,
         .create = qemu_chr_open_spice_port,
         .create = qemu_chr_open_spice_port,

+ 1 - 1
stubs/monitor.c

@@ -11,6 +11,6 @@ int monitor_get_fd(Monitor *mon, const char *name, Error **errp)
     return -1;
     return -1;
 }
 }
 
 
-void monitor_init(CharDriverState *chr, int flags)
+void monitor_init(Chardev *chr, int flags)
 {
 {
 }
 }

+ 2 - 2
stubs/replay.c

@@ -30,11 +30,11 @@ void replay_finish(void)
 {
 {
 }
 }
 
 
-void replay_register_char_driver(CharDriverState *chr)
+void replay_register_char_driver(Chardev *chr)
 {
 {
 }
 }
 
 
-void replay_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
+void replay_chr_be_write(Chardev *s, uint8_t *buf, int len)
 {
 {
     abort();
     abort();
 }
 }

+ 5 - 5
tests/test-char.c

@@ -40,7 +40,7 @@ static void fe_event(void *opaque, int event)
 #ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS
 #ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS
 static void char_stdio_test_subprocess(void)
 static void char_stdio_test_subprocess(void)
 {
 {
-    CharDriverState *chr;
+    Chardev *chr;
     CharBackend be;
     CharBackend be;
     int ret;
     int ret;
 
 
@@ -68,7 +68,7 @@ static void char_stdio_test(void)
 static void char_ringbuf_test(void)
 static void char_ringbuf_test(void)
 {
 {
     QemuOpts *opts;
     QemuOpts *opts;
-    CharDriverState *chr;
+    Chardev *chr;
     CharBackend be;
     CharBackend be;
     char *data;
     char *data;
     int ret;
     int ret;
@@ -109,7 +109,7 @@ static void char_ringbuf_test(void)
 static void char_mux_test(void)
 static void char_mux_test(void)
 {
 {
     QemuOpts *opts;
     QemuOpts *opts;
-    CharDriverState *chr, *base;
+    Chardev *chr, *base;
     char *data;
     char *data;
     FeHandler h1 = { 0, }, h2 = { 0, };
     FeHandler h1 = { 0, }, h2 = { 0, };
     CharBackend chr_be1, chr_be2;
     CharBackend chr_be1, chr_be2;
@@ -185,7 +185,7 @@ static void char_mux_test(void)
 static void char_null_test(void)
 static void char_null_test(void)
 {
 {
     Error *err = NULL;
     Error *err = NULL;
-    CharDriverState *chr;
+    Chardev *chr;
     CharBackend be;
     CharBackend be;
     int ret;
     int ret;
 
 
@@ -227,7 +227,7 @@ static void char_null_test(void)
 
 
 static void char_invalid_test(void)
 static void char_invalid_test(void)
 {
 {
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     chr = qemu_chr_new("label-invalid", "invalid");
     chr = qemu_chr_new("label-invalid", "invalid");
     g_assert_null(chr);
     g_assert_null(chr);

+ 2 - 2
tests/vhost-user-test.c

@@ -454,7 +454,7 @@ static void chr_event(void *opaque, int event)
 static void test_server_create_chr(TestServer *server, const gchar *opt)
 static void test_server_create_chr(TestServer *server, const gchar *opt)
 {
 {
     gchar *chr_path;
     gchar *chr_path;
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     chr_path = g_strdup_printf("unix:%s%s", server->socket_path, opt);
     chr_path = g_strdup_printf("unix:%s%s", server->socket_path, opt);
     chr = qemu_chr_new(server->chr_name, chr_path);
     chr = qemu_chr_new(server->chr_name, chr_path);
@@ -486,7 +486,7 @@ static inline void test_server_connect(TestServer *server)
 static gboolean _test_server_free(TestServer *server)
 static gboolean _test_server_free(TestServer *server)
 {
 {
     int i;
     int i;
-    CharDriverState *chr = qemu_chr_fe_get_driver(&server->chr);
+    Chardev *chr = qemu_chr_fe_get_driver(&server->chr);
 
 
     qemu_chr_fe_deinit(&server->chr);
     qemu_chr_fe_deinit(&server->chr);
     qemu_chr_delete(chr);
     qemu_chr_delete(chr);

+ 20 - 20
ui/console.c

@@ -158,7 +158,7 @@ struct QemuConsole {
     int esc_params[MAX_ESC_PARAMS];
     int esc_params[MAX_ESC_PARAMS];
     int nb_esc_params;
     int nb_esc_params;
 
 
-    CharDriverState *chr;
+    Chardev *chr;
     /* fifo for key pressed */
     /* fifo for key pressed */
     QEMUFIFO out_fifo;
     QEMUFIFO out_fifo;
     uint8_t out_fifo_buf[16];
     uint8_t out_fifo_buf[16];
@@ -183,7 +183,7 @@ static int nb_consoles = 0;
 static bool cursor_visible_phase;
 static bool cursor_visible_phase;
 static QEMUTimer *cursor_timer;
 static QEMUTimer *cursor_timer;
 
 
-static void text_console_do_init(CharDriverState *chr, DisplayState *ds);
+static void text_console_do_init(Chardev *chr, DisplayState *ds);
 static void dpy_refresh(DisplayState *s);
 static void dpy_refresh(DisplayState *s);
 static DisplayState *get_alloc_displaystate(void);
 static DisplayState *get_alloc_displaystate(void);
 static void text_console_update_cursor_timer(void);
 static void text_console_update_cursor_timer(void);
@@ -1046,14 +1046,14 @@ void console_select(unsigned int index)
     }
     }
 }
 }
 
 
-typedef struct VCDriverState {
-    CharDriverState parent;
+typedef struct VCChardev {
+    Chardev parent;
     QemuConsole *console;
     QemuConsole *console;
-} VCDriverState;
+} VCChardev;
 
 
-static int console_puts(CharDriverState *chr, const uint8_t *buf, int len)
+static int console_puts(Chardev *chr, const uint8_t *buf, int len)
 {
 {
-    VCDriverState *drv = (VCDriverState *)chr;
+    VCChardev *drv = (VCChardev *)chr;
     QemuConsole *s = drv->console;
     QemuConsole *s = drv->console;
     int i;
     int i;
 
 
@@ -1962,9 +1962,9 @@ int qemu_console_get_height(QemuConsole *con, int fallback)
     return con ? surface_height(con->surface) : fallback;
     return con ? surface_height(con->surface) : fallback;
 }
 }
 
 
-static void text_console_set_echo(CharDriverState *chr, bool echo)
+static void text_console_set_echo(Chardev *chr, bool echo)
 {
 {
-    VCDriverState *drv = (VCDriverState *)chr;
+    VCChardev *drv = (VCChardev *)chr;
     QemuConsole *s = drv->console;
     QemuConsole *s = drv->console;
 
 
     s->echo = echo;
     s->echo = echo;
@@ -2003,9 +2003,9 @@ static const GraphicHwOps text_console_ops = {
     .text_update = text_console_update,
     .text_update = text_console_update,
 };
 };
 
 
-static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
+static void text_console_do_init(Chardev *chr, DisplayState *ds)
 {
 {
-    VCDriverState *drv = (VCDriverState *)chr;
+    VCChardev *drv = (VCChardev *)chr;
     QemuConsole *s = drv->console;
     QemuConsole *s = drv->console;
     int g_width = 80 * FONT_WIDTH;
     int g_width = 80 * FONT_WIDTH;
     int g_height = 24 * FONT_HEIGHT;
     int g_height = 24 * FONT_HEIGHT;
@@ -2058,11 +2058,11 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
 
 
 static const CharDriver vc_driver;
 static const CharDriver vc_driver;
 
 
-static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
+static Chardev *text_console_init(ChardevVC *vc, Error **errp)
 {
 {
     ChardevCommon *common = qapi_ChardevVC_base(vc);
     ChardevCommon *common = qapi_ChardevVC_base(vc);
-    CharDriverState *chr;
-    VCDriverState *drv;
+    Chardev *chr;
+    VCChardev *drv;
     QemuConsole *s;
     QemuConsole *s;
     unsigned width = 0;
     unsigned width = 0;
     unsigned height = 0;
     unsigned height = 0;
@@ -2099,7 +2099,7 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
     }
     }
 
 
     s->chr = chr;
     s->chr = chr;
-    drv = (VCDriverState *)chr;
+    drv = (VCChardev *)chr;
     drv->console = s;
     drv->console = s;
 
 
     if (display_state) {
     if (display_state) {
@@ -2110,10 +2110,10 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
 
 
 static VcHandler *vc_handler = text_console_init;
 static VcHandler *vc_handler = text_console_init;
 
 
-static CharDriverState *vc_init(const CharDriver *driver,
-                                const char *id, ChardevBackend *backend,
-                                ChardevReturn *ret, bool *be_opened,
-                                Error **errp)
+static Chardev *vc_init(const CharDriver *driver,
+                        const char *id, ChardevBackend *backend,
+                        ChardevReturn *ret, bool *be_opened,
+                        Error **errp)
 {
 {
     /* console/chardev init sometimes completes elsewhere in a 2nd
     /* console/chardev init sometimes completes elsewhere in a 2nd
      * stage, so defer OPENED events until they are fully initialized
      * stage, so defer OPENED events until they are fully initialized
@@ -2204,7 +2204,7 @@ static const TypeInfo qemu_console_info = {
 };
 };
 
 
 static const CharDriver vc_driver = {
 static const CharDriver vc_driver = {
-    .instance_size = sizeof(VCDriverState),
+    .instance_size = sizeof(VCChardev),
     .kind = CHARDEV_BACKEND_KIND_VC,
     .kind = CHARDEV_BACKEND_KIND_VC,
     .parse = qemu_chr_parse_vc,
     .parse = qemu_chr_parse_vc,
     .create = vc_init,
     .create = vc_init,

+ 13 - 13
ui/gtk.c

@@ -181,11 +181,11 @@ struct GtkDisplayState {
     bool ignore_keys;
     bool ignore_keys;
 };
 };
 
 
-typedef struct VCDriverState {
-    CharDriverState parent;
+typedef struct VCChardev {
+    Chardev parent;
     VirtualConsole *console;
     VirtualConsole *console;
     bool echo;
     bool echo;
-} VCDriverState;
+} VCChardev;
 
 
 static void gd_grab_pointer(VirtualConsole *vc, const char *reason);
 static void gd_grab_pointer(VirtualConsole *vc, const char *reason);
 static void gd_ungrab_pointer(GtkDisplayState *s);
 static void gd_ungrab_pointer(GtkDisplayState *s);
@@ -1689,18 +1689,18 @@ static void gd_vc_adjustment_changed(GtkAdjustment *adjustment, void *opaque)
     }
     }
 }
 }
 
 
-static int gd_vc_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
+static int gd_vc_chr_write(Chardev *chr, const uint8_t *buf, int len)
 {
 {
-    VCDriverState *vcd = (VCDriverState *)chr;
+    VCChardev *vcd = (VCChardev *)chr;
     VirtualConsole *vc = vcd->console;
     VirtualConsole *vc = vcd->console;
 
 
     vte_terminal_feed(VTE_TERMINAL(vc->vte.terminal), (const char *)buf, len);
     vte_terminal_feed(VTE_TERMINAL(vc->vte.terminal), (const char *)buf, len);
     return len;
     return len;
 }
 }
 
 
-static void gd_vc_chr_set_echo(CharDriverState *chr, bool echo)
+static void gd_vc_chr_set_echo(Chardev *chr, bool echo)
 {
 {
-    VCDriverState *vcd = (VCDriverState *)chr;
+    VCChardev *vcd = (VCChardev *)chr;
     VirtualConsole *vc = vcd->console;
     VirtualConsole *vc = vcd->console;
 
 
     if (vc) {
     if (vc) {
@@ -1711,19 +1711,19 @@ static void gd_vc_chr_set_echo(CharDriverState *chr, bool echo)
 }
 }
 
 
 static int nb_vcs;
 static int nb_vcs;
-static CharDriverState *vcs[MAX_VCS];
+static Chardev *vcs[MAX_VCS];
 
 
-static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp)
+static Chardev *gd_vc_handler(ChardevVC *vc, Error **errp)
 {
 {
     static const CharDriver gd_vc_driver = {
     static const CharDriver gd_vc_driver = {
-        .instance_size = sizeof(VCDriverState),
+        .instance_size = sizeof(VCChardev),
         .kind = CHARDEV_BACKEND_KIND_VC,
         .kind = CHARDEV_BACKEND_KIND_VC,
         .chr_write = gd_vc_chr_write,
         .chr_write = gd_vc_chr_write,
         .chr_set_echo = gd_vc_chr_set_echo,
         .chr_set_echo = gd_vc_chr_set_echo,
     };
     };
 
 
     ChardevCommon *common = qapi_ChardevVC_base(vc);
     ChardevCommon *common = qapi_ChardevVC_base(vc);
-    CharDriverState *chr;
+    Chardev *chr;
 
 
     if (nb_vcs == MAX_VCS) {
     if (nb_vcs == MAX_VCS) {
         error_setg(errp, "Maximum number of consoles reached");
         error_setg(errp, "Maximum number of consoles reached");
@@ -1768,14 +1768,14 @@ static gboolean gd_vc_in(VteTerminal *terminal, gchar *text, guint size,
 }
 }
 
 
 static GSList *gd_vc_vte_init(GtkDisplayState *s, VirtualConsole *vc,
 static GSList *gd_vc_vte_init(GtkDisplayState *s, VirtualConsole *vc,
-                              CharDriverState *chr, int idx,
+                              Chardev *chr, int idx,
                               GSList *group, GtkWidget *view_menu)
                               GSList *group, GtkWidget *view_menu)
 {
 {
     char buffer[32];
     char buffer[32];
     GtkWidget *box;
     GtkWidget *box;
     GtkWidget *scrollbar;
     GtkWidget *scrollbar;
     GtkAdjustment *vadjustment;
     GtkAdjustment *vadjustment;
-    VCDriverState *vcd = (VCDriverState *)chr;
+    VCChardev *vcd = (VCChardev *)chr;
 
 
     vc->s = s;
     vc->s = s;
     vc->vte.echo = vcd->echo;
     vc->vte.echo = vcd->echo;

+ 5 - 5
vl.c

@@ -151,10 +151,10 @@ static int full_screen = 0;
 static int no_frame = 0;
 static int no_frame = 0;
 int no_quit = 0;
 int no_quit = 0;
 static bool grab_on_hover;
 static bool grab_on_hover;
-CharDriverState *serial_hds[MAX_SERIAL_PORTS];
-CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
-CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
-CharDriverState *sclp_hds[MAX_SCLP_CONSOLES];
+Chardev *serial_hds[MAX_SERIAL_PORTS];
+Chardev *parallel_hds[MAX_PARALLEL_PORTS];
+Chardev *virtcon_hds[MAX_VIRTIO_CONSOLES];
+Chardev *sclp_hds[MAX_SCLP_CONSOLES];
 int win2k_install_hack = 0;
 int win2k_install_hack = 0;
 int singlestep = 0;
 int singlestep = 0;
 int smp_cpus = 1;
 int smp_cpus = 1;
@@ -2322,7 +2322,7 @@ static int fsdev_init_func(void *opaque, QemuOpts *opts, Error **errp)
 
 
 static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
 static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
 {
 {
-    CharDriverState *chr;
+    Chardev *chr;
     const char *chardev;
     const char *chardev;
     const char *mode;
     const char *mode;
     int flags;
     int flags;

+ 1 - 1
xen-common-stub.c

@@ -9,6 +9,6 @@
 #include "qemu-common.h"
 #include "qemu-common.h"
 #include "hw/xen/xen.h"
 #include "hw/xen/xen.h"
 
 
-void xenstore_store_pv_console_info(int i, CharDriverState *chr)
+void xenstore_store_pv_console_info(int i, Chardev *chr)
 {
 {
 }
 }

+ 2 - 2
xen-common.c

@@ -25,7 +25,7 @@
     do { } while (0)
     do { } while (0)
 #endif
 #endif
 
 
-static int store_dev_info(int domid, CharDriverState *cs, const char *string)
+static int store_dev_info(int domid, Chardev *cs, const char *string)
 {
 {
     struct xs_handle *xs = NULL;
     struct xs_handle *xs = NULL;
     char *path = NULL;
     char *path = NULL;
@@ -74,7 +74,7 @@ out:
     return ret;
     return ret;
 }
 }
 
 
-void xenstore_store_pv_console_info(int i, CharDriverState *chr)
+void xenstore_store_pv_console_info(int i, Chardev *chr)
 {
 {
     if (i == 0) {
     if (i == 0) {
         store_dev_info(xen_domid, chr, "/console");
         store_dev_info(xen_domid, chr, "/console");

Some files were not shown because too many files changed in this diff