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>
This commit is contained in:
parent
d5cafc733d
commit
0ec7b3e7f2
@ -85,7 +85,7 @@
|
||||
#define BUF_SIZE 256
|
||||
|
||||
typedef struct {
|
||||
CharDriverState parent;
|
||||
Chardev parent;
|
||||
|
||||
brlapi_handle_t *brlapi;
|
||||
int brlapi_fd;
|
||||
@ -98,7 +98,7 @@ typedef struct {
|
||||
uint8_t out_buf_used, out_buf_ptr;
|
||||
|
||||
QEMUTimer *cellCount_timer;
|
||||
} BaumDriverState;
|
||||
} BaumChardev;
|
||||
|
||||
/* Let's assume NABCC by default */
|
||||
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 */
|
||||
static int baum_deferred_init(BaumDriverState *baum)
|
||||
static int baum_deferred_init(BaumChardev *baum)
|
||||
{
|
||||
int tty = BRLAPI_TTY_DEFAULT;
|
||||
QemuConsole *con;
|
||||
@ -253,9 +253,9 @@ static int baum_deferred_init(BaumDriverState *baum)
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
if (!baum->out_buf_used)
|
||||
@ -279,9 +279,9 @@ static void baum_accept_input(struct CharDriverState *chr)
|
||||
}
|
||||
|
||||
/* 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;
|
||||
int room;
|
||||
*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 */
|
||||
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 };
|
||||
DPRINTF("Timeout waiting for DisplayData, sending cell count\n");
|
||||
baum_write_packet(baum, cell_count, sizeof(cell_count));
|
||||
}
|
||||
|
||||
/* 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;
|
||||
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 */
|
||||
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;
|
||||
|
||||
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 */
|
||||
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 };
|
||||
DPRINTF("writing key %x %x\n", type, value);
|
||||
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 };
|
||||
DPRINTF("writing key %x %x\n", type, value);
|
||||
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 */
|
||||
static void baum_chr_read(void *opaque)
|
||||
{
|
||||
BaumDriverState *baum = opaque;
|
||||
BaumChardev *baum = opaque;
|
||||
brlapi_keyCode_t code;
|
||||
int ret;
|
||||
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);
|
||||
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;
|
||||
BaumDriverState *baum;
|
||||
CharDriverState *chr;
|
||||
BaumChardev *baum;
|
||||
Chardev *chr;
|
||||
brlapi_handle_t *handle;
|
||||
|
||||
chr = qemu_chr_alloc(driver, common, errp);
|
||||
if (!chr) {
|
||||
return NULL;
|
||||
}
|
||||
baum = (BaumDriverState *)chr;
|
||||
baum = (BaumChardev *)chr;
|
||||
|
||||
handle = g_malloc0(brlapi_getHandleSize());
|
||||
baum->brlapi = handle;
|
||||
@ -666,7 +668,7 @@ fail_handle:
|
||||
static void register_types(void)
|
||||
{
|
||||
static const CharDriver driver = {
|
||||
.instance_size = sizeof(BaumDriverState),
|
||||
.instance_size = sizeof(BaumChardev),
|
||||
.kind = CHARDEV_BACKEND_KIND_BRAILLE,
|
||||
.create = chr_baum_init,
|
||||
.chr_write = baum_write,
|
||||
|
@ -31,7 +31,7 @@
|
||||
#define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6)
|
||||
|
||||
typedef struct {
|
||||
CharDriverState parent;
|
||||
Chardev parent;
|
||||
|
||||
QemuInputHandlerState *hs;
|
||||
int axis[INPUT_AXIS__MAX];
|
||||
@ -39,11 +39,11 @@ typedef struct {
|
||||
bool btnc[INPUT_BUTTON__MAX];
|
||||
uint8_t outbuf[32];
|
||||
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;
|
||||
|
||||
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 };
|
||||
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,
|
||||
InputEvent *evt)
|
||||
{
|
||||
MouseState *mouse = (MouseState *)dev;
|
||||
MouseChardev *mouse = (MouseChardev *)dev;
|
||||
InputMoveEvent *move;
|
||||
InputBtnEvent *btn;
|
||||
|
||||
@ -122,22 +122,22 @@ static void msmouse_input_event(DeviceState *dev, QemuConsole *src,
|
||||
|
||||
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_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 */
|
||||
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);
|
||||
}
|
||||
@ -149,16 +149,16 @@ static QemuInputHandler msmouse_handler = {
|
||||
.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;
|
||||
MouseState *mouse;
|
||||
CharDriverState *chr;
|
||||
MouseChardev *mouse;
|
||||
Chardev *chr;
|
||||
|
||||
chr = qemu_chr_alloc(driver, common, errp);
|
||||
if (!chr) {
|
||||
@ -166,7 +166,7 @@ static CharDriverState *qemu_chr_open_msmouse(const CharDriver *driver,
|
||||
}
|
||||
*be_opened = false;
|
||||
|
||||
mouse = (MouseState *)chr;
|
||||
mouse = (MouseChardev *)chr;
|
||||
mouse->hs = qemu_input_handler_register((DeviceState *)mouse,
|
||||
&msmouse_handler);
|
||||
|
||||
@ -177,7 +177,7 @@ static CharDriverState *qemu_chr_open_msmouse(const CharDriver *driver,
|
||||
static void register_types(void)
|
||||
{
|
||||
static const CharDriver driver = {
|
||||
.instance_size = sizeof(MouseState),
|
||||
.instance_size = sizeof(MouseChardev),
|
||||
.kind = CHARDEV_BACKEND_KIND_MSMOUSE,
|
||||
.create = qemu_chr_open_msmouse,
|
||||
.chr_write = msmouse_chr_write,
|
||||
|
@ -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)
|
||||
{
|
||||
RngEgd *s = RNG_EGD(b);
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
if (s->chr_name == NULL) {
|
||||
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)
|
||||
{
|
||||
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) {
|
||||
return g_strdup(chr->label);
|
||||
|
@ -30,14 +30,14 @@
|
||||
#define BUF_SIZE 32
|
||||
|
||||
typedef struct {
|
||||
CharDriverState parent;
|
||||
Chardev parent;
|
||||
|
||||
uint8_t in_buf[32];
|
||||
int in_buf_used;
|
||||
} TestdevCharState;
|
||||
} TestdevChardev;
|
||||
|
||||
/* 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;
|
||||
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 */
|
||||
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;
|
||||
|
||||
while (len) {
|
||||
@ -103,15 +103,15 @@ static int testdev_write(CharDriverState *chr, const uint8_t *buf, int 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;
|
||||
|
||||
@ -121,7 +121,7 @@ static CharDriverState *chr_testdev_init(const CharDriver *driver,
|
||||
static void register_types(void)
|
||||
{
|
||||
static const CharDriver driver = {
|
||||
.instance_size = sizeof(TestdevCharState),
|
||||
.instance_size = sizeof(TestdevChardev),
|
||||
.kind = CHARDEV_BACKEND_KIND_TESTDEV,
|
||||
.create = chr_testdev_init,
|
||||
.chr_write = testdev_write,
|
||||
|
12
gdbstub.c
12
gdbstub.c
@ -305,7 +305,7 @@ typedef struct GDBState {
|
||||
int running_state;
|
||||
#else
|
||||
CharBackend chr;
|
||||
CharDriverState *mon_chr;
|
||||
Chardev *mon_chr;
|
||||
#endif
|
||||
char syscall_buf[256];
|
||||
gdb_syscall_complete_cb current_syscall_cb;
|
||||
@ -1473,7 +1473,7 @@ void gdb_exit(CPUArchState *env, int code)
|
||||
GDBState *s;
|
||||
char buf[4];
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
#endif
|
||||
|
||||
s = gdbserver_state;
|
||||
@ -1698,7 +1698,7 @@ static void gdb_monitor_output(GDBState *s, const char *msg, int len)
|
||||
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;
|
||||
int max_sz;
|
||||
@ -1729,11 +1729,11 @@ int gdbserver_start(const char *device)
|
||||
{
|
||||
GDBState *s;
|
||||
char gdbstub_device_name[128];
|
||||
CharDriverState *chr = NULL;
|
||||
CharDriverState *mon_chr;
|
||||
Chardev *chr = NULL;
|
||||
Chardev *mon_chr;
|
||||
ChardevCommon common = { 0 };
|
||||
static const CharDriver driver = {
|
||||
.instance_size = sizeof(CharDriverState),
|
||||
.instance_size = sizeof(Chardev),
|
||||
.kind = -1,
|
||||
.chr_write = gdb_monitor_write,
|
||||
};
|
||||
|
@ -118,7 +118,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
||||
};
|
||||
|
||||
if (i < MAX_SERIAL_PORTS) {
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
chr = serial_hds[i];
|
||||
|
||||
|
@ -107,7 +107,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
||||
};
|
||||
|
||||
if (i < MAX_SERIAL_PORTS) {
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
chr = serial_hds[i];
|
||||
|
||||
|
@ -187,7 +187,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
||||
};
|
||||
|
||||
if (i < MAX_SERIAL_PORTS) {
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
chr = serial_hds[i];
|
||||
|
||||
|
@ -786,7 +786,7 @@ static void n8x0_cbus_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,
|
||||
csrhci_pins_get(radio)[csrhci_pin_reset]);
|
||||
|
@ -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,
|
||||
MemoryRegion *sysmem,
|
||||
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);
|
||||
|
||||
|
@ -2024,7 +2024,7 @@ static PXA2xxFIrState *pxa2xx_fir_init(MemoryRegion *sysmem,
|
||||
hwaddr base,
|
||||
qemu_irq irq, qemu_irq rx_dma,
|
||||
qemu_irq tx_dma,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *sbd;
|
||||
|
@ -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,
|
||||
MemoryRegion *mem, CharDriverState *chr)
|
||||
MemoryRegion *mem, Chardev *chr)
|
||||
{
|
||||
char *nodename;
|
||||
hwaddr base = vms->memmap[uart].base;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "qapi/error.h"
|
||||
|
||||
struct csrhci_s {
|
||||
CharDriverState parent;
|
||||
Chardev parent;
|
||||
int enable;
|
||||
qemu_irq *pins;
|
||||
int pin_state;
|
||||
@ -79,7 +79,7 @@ enum {
|
||||
|
||||
static inline void csrhci_fifo_wake(struct csrhci_s *s)
|
||||
{
|
||||
CharDriverState *chr = (CharDriverState *)s;
|
||||
Chardev *chr = (Chardev *)s;
|
||||
CharBackend *be = chr->be;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
static int csrhci_write(struct CharDriverState *chr,
|
||||
static int csrhci_write(struct Chardev *chr,
|
||||
const uint8_t *buf, int len)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
static int csrhci_ioctl(struct CharDriverState *chr, int cmd, void *arg)
|
||||
static int csrhci_ioctl(struct Chardev *chr, int cmd, void *arg)
|
||||
{
|
||||
QEMUSerialSetParams *ssp;
|
||||
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;
|
||||
|
||||
return s->pins;
|
||||
}
|
||||
|
||||
CharDriverState *uart_hci_init(void)
|
||||
Chardev *uart_hci_init(void)
|
||||
{
|
||||
static const CharDriver hci_driver = {
|
||||
.instance_size = sizeof(struct csrhci_s),
|
||||
@ -472,7 +472,7 @@ CharDriverState *uart_hci_init(void)
|
||||
};
|
||||
Error *err = NULL;
|
||||
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;
|
||||
|
||||
if (err) {
|
||||
|
@ -689,7 +689,7 @@ static const VMStateDescription vmstate_escc = {
|
||||
};
|
||||
|
||||
MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB,
|
||||
CharDriverState *chrA, CharDriverState *chrB,
|
||||
Chardev *chrA, Chardev *chrB,
|
||||
int clock, int it_shift)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
@ -586,7 +586,7 @@ static const VMStateDescription vmstate_exynos4210_uart = {
|
||||
DeviceState *exynos4210_uart_create(hwaddr addr,
|
||||
int fifo_size,
|
||||
int channel,
|
||||
CharDriverState *chr,
|
||||
Chardev *chr,
|
||||
qemu_irq irq)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
@ -170,7 +170,7 @@ static void imx_serial_write(void *opaque, hwaddr offset,
|
||||
uint64_t value, unsigned size)
|
||||
{
|
||||
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;
|
||||
|
||||
DPRINTF("write(offset=0x%" HWADDR_PRIx ", value = 0x%x) to %s\n",
|
||||
|
@ -275,7 +275,7 @@ static void mcf_uart_receive(void *opaque, const uint8_t *buf, int size)
|
||||
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;
|
||||
|
||||
@ -300,7 +300,7 @@ static const MemoryRegionOps mcf_uart_ops = {
|
||||
void mcf_uart_mm_init(MemoryRegion *sysmem,
|
||||
hwaddr base,
|
||||
qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
mcf_uart_state *s;
|
||||
|
||||
|
@ -54,7 +54,7 @@ void omap_uart_reset(struct omap_uart_s *s)
|
||||
struct omap_uart_s *omap_uart_init(hwaddr base,
|
||||
qemu_irq irq, omap_clk fclk, omap_clk iclk,
|
||||
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);
|
||||
|
||||
@ -163,7 +163,7 @@ struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
|
||||
struct omap_target_agent_s *ta,
|
||||
qemu_irq irq, omap_clk fclk, omap_clk iclk,
|
||||
qemu_irq txdma, qemu_irq rxdma,
|
||||
const char *label, CharDriverState *chr)
|
||||
const char *label, Chardev *chr)
|
||||
{
|
||||
hwaddr base = omap_l4_attach(ta, 0, NULL);
|
||||
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;
|
||||
}
|
||||
|
||||
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 */
|
||||
s->serial = serial_mm_init(get_system_memory(), s->base, 2, s->irq,
|
||||
|
@ -603,7 +603,7 @@ static const MemoryRegionOps parallel_mm_ops = {
|
||||
/* If fd is zero, it means that the parallel device uses the console */
|
||||
bool parallel_mm_init(MemoryRegion *address_space,
|
||||
hwaddr base, int it_shift, qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
ParallelState *s;
|
||||
|
||||
|
@ -121,7 +121,7 @@ static void serial_register_types(void)
|
||||
|
||||
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;
|
||||
ISADevice *isadev;
|
||||
|
@ -937,7 +937,7 @@ const MemoryRegionOps serial_io_ops = {
|
||||
};
|
||||
|
||||
SerialState *serial_init(int base, qemu_irq irq, int baudbase,
|
||||
CharDriverState *chr, MemoryRegion *system_io)
|
||||
Chardev *chr, MemoryRegion *system_io)
|
||||
{
|
||||
SerialState *s;
|
||||
|
||||
@ -993,7 +993,7 @@ static const MemoryRegionOps serial_mm_ops[3] = {
|
||||
SerialState *serial_mm_init(MemoryRegion *address_space,
|
||||
hwaddr base, int it_shift,
|
||||
qemu_irq irq, int baudbase,
|
||||
CharDriverState *chr, enum device_endian end)
|
||||
Chardev *chr, enum device_endian end)
|
||||
{
|
||||
SerialState *s;
|
||||
|
||||
|
@ -356,7 +356,7 @@ static const MemoryRegionOps sh_serial_ops = {
|
||||
|
||||
void sh_serial_init(MemoryRegion *sysmem,
|
||||
hwaddr base, int feat,
|
||||
uint32_t freq, CharDriverState *chr,
|
||||
uint32_t freq, Chardev *chr,
|
||||
qemu_irq eri_source,
|
||||
qemu_irq rxi_source,
|
||||
qemu_irq txi_source,
|
||||
|
@ -141,7 +141,7 @@ static target_ulong h_get_term_char(PowerPCCPU *cpu, sPAPRMachineState *spapr,
|
||||
return H_SUCCESS;
|
||||
}
|
||||
|
||||
void spapr_vty_create(VIOsPAPRBus *bus, CharDriverState *chardev)
|
||||
void spapr_vty_create(VIOsPAPRBus *bus, Chardev *chardev)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
||||
|
@ -168,7 +168,7 @@ static void virtconsole_realize(DeviceState *dev, Error **errp)
|
||||
VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev);
|
||||
VirtConsole *vcon = VIRTIO_CONSOLE(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) {
|
||||
error_setg(errp, "Port number 0 on virtio-serial devices reserved "
|
||||
|
@ -179,7 +179,7 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,
|
||||
Error *local_err = NULL;
|
||||
Property *prop = opaque;
|
||||
CharBackend *be = qdev_get_prop_ptr(dev, prop);
|
||||
CharDriverState *s;
|
||||
Chardev *s;
|
||||
char *str;
|
||||
|
||||
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,
|
||||
CharDriverState *value)
|
||||
Chardev *value)
|
||||
{
|
||||
assert(!value || value->label);
|
||||
object_property_set_str(OBJECT(dev),
|
||||
|
@ -85,7 +85,7 @@ struct MilkymistTMU2State {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion regs_region;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
qemu_irq irq;
|
||||
|
||||
uint32_t regs[R_MAX];
|
||||
|
@ -1392,7 +1392,7 @@ static const GraphicHwOps sm501_ops = {
|
||||
};
|
||||
|
||||
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;
|
||||
DeviceState *dev;
|
||||
|
@ -288,7 +288,7 @@ MemoryRegion *isa_address_space_io(ISADevice *dev)
|
||||
|
||||
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;
|
||||
ISADevice *isadev;
|
||||
|
@ -268,7 +268,7 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
|
||||
DeviceState *d;
|
||||
ISADevice *isa;
|
||||
ISABus *bus;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
DriveInfo *drive;
|
||||
char name[5];
|
||||
int i;
|
||||
|
@ -16,7 +16,7 @@ static inline DeviceState *lm32_pic_init(qemu_irq cpu_irq)
|
||||
return dev;
|
||||
}
|
||||
|
||||
static inline DeviceState *lm32_juart_init(CharDriverState *chr)
|
||||
static inline DeviceState *lm32_juart_init(Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
||||
@ -29,7 +29,7 @@ static inline DeviceState *lm32_juart_init(CharDriverState *chr)
|
||||
|
||||
static inline DeviceState *lm32_uart_create(hwaddr addr,
|
||||
qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *s;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
static inline DeviceState *milkymist_uart_create(hwaddr base,
|
||||
qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
||||
|
@ -551,10 +551,10 @@ static void malta_fgpa_display_event(void *opaque, int event)
|
||||
}
|
||||
|
||||
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;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
s = (MaltaFPGAState *)g_malloc0(sizeof(MaltaFPGAState));
|
||||
|
||||
|
@ -869,7 +869,7 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
|
||||
s->ivshmem_bar2 = host_memory_backend_get_memory(s->hostmem,
|
||||
&error_abort);
|
||||
} else {
|
||||
CharDriverState *chr = qemu_chr_fe_get_driver(&s->server_chr);
|
||||
Chardev *chr = qemu_chr_fe_get_driver(&s->server_chr);
|
||||
assert(chr);
|
||||
|
||||
IVSHMEM_DPRINTF("using shared memory server (socket = %s)\n",
|
||||
|
@ -125,7 +125,7 @@ struct MilkymistPFPUState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion regs_region;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
qemu_irq irq;
|
||||
|
||||
uint32_t regs[R_MAX];
|
||||
|
@ -264,7 +264,7 @@ static void ccid_card_vscard_handle_message(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_delete(chr);
|
||||
|
@ -483,7 +483,7 @@ static void usb_serial_realize(USBDevice *dev, Error **errp)
|
||||
{
|
||||
USBSerialState *s = USB_SERIAL_DEV(dev);
|
||||
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_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)
|
||||
{
|
||||
USBDevice *dev;
|
||||
CharDriverState *cdrv;
|
||||
Chardev *cdrv;
|
||||
uint32_t vendorid = 0, productid = 0;
|
||||
char label[32];
|
||||
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)
|
||||
{
|
||||
USBDevice *dev;
|
||||
CharDriverState *cdrv;
|
||||
Chardev *cdrv;
|
||||
|
||||
cdrv = qemu_chr_new("braille", "braille");
|
||||
if (!cdrv)
|
||||
|
@ -284,7 +284,7 @@ static gboolean usbredir_write_unblocked(GIOChannel *chan, GIOCondition cond,
|
||||
static int usbredir_write(void *priv, uint8_t *data, int count)
|
||||
{
|
||||
USBRedirDevice *dev = priv;
|
||||
CharDriverState *chr = qemu_chr_fe_get_driver(&dev->cs);
|
||||
Chardev *chr = qemu_chr_fe_get_driver(&dev->cs);
|
||||
int r;
|
||||
|
||||
if (!chr->be_open) {
|
||||
@ -1430,7 +1430,7 @@ static void usbredir_cleanup_device_queues(USBRedirDevice *dev)
|
||||
static void usbredir_handle_destroy(USBDevice *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_delete(chr);
|
||||
|
@ -131,7 +131,7 @@ void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, DeviceState *dev,
|
||||
DeviceState *exynos4210_uart_create(hwaddr addr,
|
||||
int fifo_size,
|
||||
int channel,
|
||||
CharDriverState *chr,
|
||||
Chardev *chr,
|
||||
qemu_irq irq);
|
||||
|
||||
#endif /* EXYNOS4210_H */
|
||||
|
@ -664,14 +664,14 @@ struct omap_uart_s;
|
||||
struct omap_uart_s *omap_uart_init(hwaddr base,
|
||||
qemu_irq irq, omap_clk fclk, omap_clk iclk,
|
||||
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_target_agent_s *ta,
|
||||
qemu_irq irq, omap_clk fclk, omap_clk iclk,
|
||||
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_attach(struct omap_uart_s *s, CharDriverState *chr);
|
||||
void omap_uart_attach(struct omap_uart_s *s, Chardev *chr);
|
||||
|
||||
struct omap_mpuio_s;
|
||||
qemu_irq *omap_mpuio_in_get(struct omap_mpuio_s *s);
|
||||
|
@ -127,8 +127,8 @@ enum {
|
||||
csrhci_pin_wakeup,
|
||||
__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 */
|
||||
struct bt_l2cap_device_s;
|
||||
|
@ -51,7 +51,7 @@ typedef struct {
|
||||
|
||||
static inline DeviceState *cadence_uart_create(hwaddr addr,
|
||||
qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *s;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#define TYPE_ESCC "escc"
|
||||
#define ESCC_SIZE 4
|
||||
MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB,
|
||||
CharDriverState *chrA, CharDriverState *chrB,
|
||||
Chardev *chrA, Chardev *chrB,
|
||||
int clock, int it_shift);
|
||||
|
||||
void slavio_serial_ms_kbd_init(hwaddr base, qemu_irq irq,
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
static inline DeviceState *pl011_create(hwaddr addr,
|
||||
qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *s;
|
||||
@ -34,7 +34,7 @@ static inline DeviceState *pl011_create(hwaddr addr,
|
||||
|
||||
static inline DeviceState *pl011_luminary_create(hwaddr addr,
|
||||
qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *s;
|
||||
|
@ -88,11 +88,11 @@ void serial_set_frequency(SerialState *s, uint32_t frequency);
|
||||
|
||||
/* legacy pre qom */
|
||||
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,
|
||||
hwaddr base, int it_shift,
|
||||
qemu_irq irq, int baudbase,
|
||||
CharDriverState *chr, enum device_endian end);
|
||||
Chardev *chr, enum device_endian end);
|
||||
|
||||
/* serial-isa.c */
|
||||
#define TYPE_ISA_SERIAL "isa-serial"
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
static inline DeviceState *xilinx_uartlite_create(hwaddr addr,
|
||||
qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *s;
|
||||
|
@ -48,7 +48,7 @@ etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr,
|
||||
|
||||
static inline DeviceState *etraxfs_ser_create(hwaddr addr,
|
||||
qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
Chardev *chr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *s;
|
||||
|
@ -65,6 +65,6 @@ qemu_irq tc6393xb_l3v_get(TC6393xbState *s);
|
||||
/* sm501.c */
|
||||
void sm501_init(struct MemoryRegion *address_space_mem, uint32_t base,
|
||||
uint32_t local_mem_bytes, qemu_irq irq,
|
||||
CharDriverState *chr);
|
||||
Chardev *chr);
|
||||
|
||||
#endif
|
||||
|
@ -181,7 +181,7 @@ void parallel_hds_isa_init(ISABus *bus, int n);
|
||||
|
||||
bool parallel_mm_init(MemoryRegion *address_space,
|
||||
hwaddr base, int it_shift, qemu_irq irq,
|
||||
CharDriverState *chr);
|
||||
Chardev *chr);
|
||||
|
||||
/* i8259.c */
|
||||
|
||||
|
@ -11,10 +11,10 @@ uint64_t mcf_uart_read(void *opaque, hwaddr addr,
|
||||
unsigned size);
|
||||
void mcf_uart_write(void *opaque, hwaddr addr,
|
||||
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,
|
||||
hwaddr base,
|
||||
qemu_irq irq, CharDriverState *chr);
|
||||
qemu_irq irq, Chardev *chr);
|
||||
|
||||
/* mcf_intc.c */
|
||||
qemu_irq *mcf_intc_init(struct MemoryRegion *sysmem,
|
||||
|
@ -127,7 +127,7 @@ int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq);
|
||||
|
||||
VIOsPAPRDevice *vty_lookup(sPAPRMachineState *spapr, target_ulong reg);
|
||||
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_vscsi_create(VIOsPAPRBus *bus);
|
||||
|
||||
|
@ -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_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_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_drive(DeviceState *dev, const char *name,
|
||||
BlockBackend *value, Error **errp);
|
||||
|
@ -42,7 +42,7 @@ void tmu012_init(struct MemoryRegion *sysmem, hwaddr base,
|
||||
#define SH_SERIAL_FEAT_SCIF (1 << 0)
|
||||
void sh_serial_init(MemoryRegion *sysmem,
|
||||
hwaddr base, int feat,
|
||||
uint32_t freq, CharDriverState *chr,
|
||||
uint32_t freq, Chardev *chr,
|
||||
qemu_irq eri_source,
|
||||
qemu_irq rxi_source,
|
||||
qemu_irq txi_source,
|
||||
|
@ -100,7 +100,7 @@ DeviceState *grlib_gptimer_create(hwaddr base,
|
||||
|
||||
static inline
|
||||
DeviceState *grlib_apbuart_create(hwaddr base,
|
||||
CharDriverState *serial,
|
||||
Chardev *serial,
|
||||
qemu_irq irq)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
@ -37,7 +37,7 @@ int xen_is_pirq_msi(uint32_t msi_data);
|
||||
|
||||
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);
|
||||
|
||||
|
@ -16,7 +16,7 @@ extern Monitor *cur_mon;
|
||||
|
||||
bool monitor_cur_is_qmp(void);
|
||||
|
||||
void monitor_init(CharDriverState *chr, int flags);
|
||||
void monitor_init(Chardev *chr, int flags);
|
||||
void monitor_cleanup(void);
|
||||
|
||||
int monitor_suspend(Monitor *mon);
|
||||
|
@ -17,7 +17,7 @@ typedef struct BlockBackendRootState BlockBackendRootState;
|
||||
typedef struct BlockDriverState BlockDriverState;
|
||||
typedef struct BusClass BusClass;
|
||||
typedef struct BusState BusState;
|
||||
typedef struct CharDriverState CharDriverState;
|
||||
typedef struct Chardev Chardev;
|
||||
typedef struct CompatProperty CompatProperty;
|
||||
typedef struct CPUAddressSpace CPUAddressSpace;
|
||||
typedef struct CPUState CPUState;
|
||||
|
@ -76,9 +76,9 @@ typedef enum {
|
||||
} CharDriverFeature;
|
||||
|
||||
/* This is the backend as seen by frontend, the actual backend is
|
||||
* CharDriverState */
|
||||
* Chardev */
|
||||
typedef struct CharBackend {
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
IOEventHandler *chr_event;
|
||||
IOCanReadHandler *chr_can_read;
|
||||
IOReadHandler *chr_read;
|
||||
@ -89,7 +89,7 @@ typedef struct CharBackend {
|
||||
|
||||
typedef struct CharDriver CharDriver;
|
||||
|
||||
struct CharDriverState {
|
||||
struct Chardev {
|
||||
const CharDriver *driver;
|
||||
QemuMutex chr_write_lock;
|
||||
CharBackend *be;
|
||||
@ -99,7 +99,7 @@ struct CharDriverState {
|
||||
int be_open;
|
||||
guint fd_in_tag;
|
||||
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
|
||||
* @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:
|
||||
@ -123,8 +123,8 @@ CharDriverState *qemu_chr_alloc(const CharDriver *driver,
|
||||
*
|
||||
* 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:
|
||||
@ -146,7 +146,7 @@ void qemu_chr_parse_common(QemuOpts *opts, ChardevCommon *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
|
||||
*/
|
||||
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:
|
||||
@ -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
|
||||
* identified character backends.
|
||||
*/
|
||||
void qemu_chr_delete(CharDriverState *chr);
|
||||
void qemu_chr_delete(Chardev *chr);
|
||||
|
||||
/**
|
||||
* @qemu_chr_free:
|
||||
*
|
||||
* Destroy a character backend.
|
||||
*/
|
||||
void qemu_chr_free(CharDriverState *chr);
|
||||
void qemu_chr_free(Chardev *chr);
|
||||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
int qemu_chr_be_can_write(CharDriverState *s);
|
||||
int qemu_chr_be_can_write(Chardev *s);
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @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:
|
||||
@ -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
|
||||
* @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:
|
||||
@ -386,7 +386,7 @@ void qemu_chr_be_write_impl(CharDriverState *s, uint8_t *buf, int len);
|
||||
*
|
||||
* @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:
|
||||
@ -397,7 +397,7 @@ void qemu_chr_be_event(CharDriverState *s, int event);
|
||||
*
|
||||
* 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:
|
||||
@ -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
|
||||
* associated CharDriver.
|
||||
*/
|
||||
CharDriverState *qemu_chr_fe_get_driver(CharBackend *be);
|
||||
Chardev *qemu_chr_fe_get_driver(CharBackend *be);
|
||||
|
||||
/**
|
||||
* @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_be_generic_open(CharDriverState *s);
|
||||
void qemu_chr_be_generic_open(Chardev *s);
|
||||
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:
|
||||
*
|
||||
* 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 ||
|
||||
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);
|
||||
void qemu_chr_set_feature(CharDriverState *chr,
|
||||
void qemu_chr_set_feature(Chardev *chr,
|
||||
CharDriverFeature feature);
|
||||
QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename);
|
||||
|
||||
@ -478,29 +478,29 @@ struct CharDriver {
|
||||
ChardevBackendKind kind;
|
||||
const char *alias;
|
||||
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;
|
||||
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
@ -509,7 +509,7 @@ extern int term_escape_char;
|
||||
|
||||
|
||||
/* console.c */
|
||||
typedef CharDriverState *(VcHandler)(ChardevVC *vc, Error **errp);
|
||||
typedef Chardev *(VcHandler)(ChardevVC *vc, Error **errp);
|
||||
void register_vc_handler(VcHandler *handler);
|
||||
|
||||
#endif
|
||||
|
@ -128,9 +128,9 @@ uint64_t blkreplay_next_id(void);
|
||||
/* Character device */
|
||||
|
||||
/*! 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 */
|
||||
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. */
|
||||
void replay_char_write_event_save(int res, int offset);
|
||||
/*! Reads char write return value from the replay log. */
|
||||
|
@ -190,13 +190,13 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict);
|
||||
|
||||
#define MAX_SERIAL_PORTS 4
|
||||
|
||||
extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
|
||||
extern Chardev *serial_hds[MAX_SERIAL_PORTS];
|
||||
|
||||
/* parallel ports */
|
||||
|
||||
#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_del(Monitor *mon, const QDict *qdict);
|
||||
|
@ -64,7 +64,7 @@ typedef struct VirtualVteConsole {
|
||||
GtkWidget *box;
|
||||
GtkWidget *scrollbar;
|
||||
GtkWidget *terminal;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
bool echo;
|
||||
} VirtualVteConsole;
|
||||
#endif
|
||||
|
@ -51,7 +51,7 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
|
||||
#if SPICE_SERVER_VERSION >= 0x000c02
|
||||
void qemu_spice_register_ports(void);
|
||||
#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; }
|
||||
#endif
|
||||
|
||||
|
@ -3195,7 +3195,7 @@ static void ringbuf_completion(ReadLineState *rs, const char *str)
|
||||
ChardevInfo *chr_info = list->value;
|
||||
|
||||
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)) {
|
||||
readline_add_completion(rs, chr_info->label);
|
||||
}
|
||||
@ -3985,7 +3985,7 @@ static void __attribute__((constructor)) monitor_lock_init(void)
|
||||
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;
|
||||
Monitor *mon;
|
||||
|
@ -564,7 +564,7 @@ static void compare_sec_rs_finalize(SocketReadState *sec_rs)
|
||||
* Return 0 is success.
|
||||
* Return 1 is failed.
|
||||
*/
|
||||
static int find_and_check_chardev(CharDriverState **chr,
|
||||
static int find_and_check_chardev(Chardev **chr,
|
||||
char *chr_name,
|
||||
Error **errp)
|
||||
{
|
||||
@ -611,7 +611,7 @@ static void check_old_packet_regular(void *opaque)
|
||||
static void colo_compare_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
CompareState *s = COLO_COMPARE(uc);
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
char thread_name[64];
|
||||
static int compare_id;
|
||||
|
||||
|
@ -191,7 +191,7 @@ static void filter_redirector_cleanup(NetFilterState *nf)
|
||||
static void filter_mirror_setup(NetFilterState *nf, Error **errp)
|
||||
{
|
||||
MirrorState *s = FILTER_MIRROR(nf);
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
if (!s->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)
|
||||
{
|
||||
MirrorState *s = FILTER_REDIRECTOR(nf);
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
if (!s->indev && !s->outdev) {
|
||||
error_setg(errp, "filter redirector needs 'indev' or "
|
||||
|
@ -748,7 +748,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
|
||||
}
|
||||
} else {
|
||||
Error *err = NULL;
|
||||
CharDriverState *chr = qemu_chr_new(buf, p);
|
||||
Chardev *chr = qemu_chr_new(buf, p);
|
||||
|
||||
if (!chr) {
|
||||
error_report("could not open guest forwarding device '%s'", buf);
|
||||
|
@ -195,7 +195,7 @@ static void net_vhost_user_event(void *opaque, int event)
|
||||
const char *name = opaque;
|
||||
NetClientState *ncs[MAX_QUEUE_NUM];
|
||||
VhostUserState *s;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
Error *err = NULL;
|
||||
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,
|
||||
const char *name, CharDriverState *chr,
|
||||
const char *name, Chardev *chr,
|
||||
int queues)
|
||||
{
|
||||
Error *err = NULL;
|
||||
@ -274,10 +274,10 @@ static int net_vhost_user_init(NetClientState *peer, const char *device,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static CharDriverState *net_vhost_claim_chardev(
|
||||
static Chardev *net_vhost_claim_chardev(
|
||||
const NetdevVhostUserOptions *opts, Error **errp)
|
||||
{
|
||||
CharDriverState *chr = qemu_chr_find(opts->chardev);
|
||||
Chardev *chr = qemu_chr_find(opts->chardev);
|
||||
|
||||
if (chr == NULL) {
|
||||
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;
|
||||
const NetdevVhostUserOptions *vhost_user_opts;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
assert(netdev->type == NET_CLIENT_DRIVER_VHOST_USER);
|
||||
vhost_user_opts = &netdev->u.vhost_user;
|
||||
|
839
qemu-char.c
839
qemu-char.c
File diff suppressed because it is too large
Load Diff
2
qmp.c
2
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,
|
||||
Error **errp)
|
||||
{
|
||||
CharDriverState *s;
|
||||
Chardev *s;
|
||||
int fd;
|
||||
|
||||
fd = monitor_get_fd(cur_mon, fdname, errp);
|
||||
|
2
qtest.c
2
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)
|
||||
{
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
chr = qemu_chr_new("qtest", qtest_chrdev);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
/* Char drivers that generate qemu_chr_be_write events
|
||||
that should be saved into the log. */
|
||||
static CharDriverState **char_drivers;
|
||||
static Chardev **char_drivers;
|
||||
static int drivers_count;
|
||||
|
||||
/* Char event attributes. */
|
||||
@ -28,7 +28,7 @@ typedef struct CharEvent {
|
||||
size_t len;
|
||||
} CharEvent;
|
||||
|
||||
static int find_char_driver(CharDriverState *chr)
|
||||
static int find_char_driver(Chardev *chr)
|
||||
{
|
||||
int i = 0;
|
||||
for ( ; i < drivers_count ; ++i) {
|
||||
@ -39,7 +39,7 @@ static int find_char_driver(CharDriverState *chr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void replay_register_char_driver(CharDriverState *chr)
|
||||
void replay_register_char_driver(Chardev *chr)
|
||||
{
|
||||
if (replay_mode == REPLAY_MODE_NONE) {
|
||||
return;
|
||||
@ -49,7 +49,7 @@ void replay_register_char_driver(CharDriverState *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));
|
||||
|
||||
|
@ -6,29 +6,29 @@
|
||||
#include <spice/protocol.h>
|
||||
|
||||
|
||||
typedef struct SpiceCharDriver {
|
||||
CharDriverState parent;
|
||||
typedef struct SpiceChardev {
|
||||
Chardev parent;
|
||||
|
||||
SpiceCharDeviceInstance sin;
|
||||
SpiceCharDeviceInstance sin;
|
||||
bool active;
|
||||
bool blocked;
|
||||
const uint8_t *datapos;
|
||||
int datalen;
|
||||
QLIST_ENTRY(SpiceCharDriver) next;
|
||||
} SpiceCharDriver;
|
||||
QLIST_ENTRY(SpiceChardev) next;
|
||||
} SpiceChardev;
|
||||
|
||||
typedef struct SpiceCharSource {
|
||||
GSource source;
|
||||
SpiceCharDriver *scd;
|
||||
SpiceChardev *scd;
|
||||
} SpiceCharSource;
|
||||
|
||||
static QLIST_HEAD(, SpiceCharDriver) spice_chars =
|
||||
static QLIST_HEAD(, SpiceChardev) spice_chars =
|
||||
QLIST_HEAD_INITIALIZER(spice_chars);
|
||||
|
||||
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 last_out;
|
||||
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)
|
||||
{
|
||||
SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin);
|
||||
SpiceChardev *scd = container_of(sin, SpiceChardev, sin);
|
||||
int bytes = MIN(len, scd->datalen);
|
||||
|
||||
if (bytes > 0) {
|
||||
@ -71,8 +71,8 @@ static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
|
||||
#if SPICE_SERVER_VERSION >= 0x000c02
|
||||
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;
|
||||
|
||||
switch (event) {
|
||||
@ -90,8 +90,8 @@ static void vmc_event(SpiceCharDeviceInstance *sin, uint8_t event)
|
||||
|
||||
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) ||
|
||||
(!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) {
|
||||
return;
|
||||
@ -130,7 +130,7 @@ static void vmc_register_interface(SpiceCharDriver *scd)
|
||||
trace_spice_vmc_register_interface(scd);
|
||||
}
|
||||
|
||||
static void vmc_unregister_interface(SpiceCharDriver *scd)
|
||||
static void vmc_unregister_interface(SpiceChardev *scd)
|
||||
{
|
||||
if (!scd->active) {
|
||||
return;
|
||||
@ -170,9 +170,9 @@ static GSourceFuncs SpiceCharSourceFuncs = {
|
||||
.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;
|
||||
|
||||
assert(cond & G_IO_OUT);
|
||||
@ -184,9 +184,9 @@ static GSource *spice_chr_add_watch(CharDriverState *chr, GIOCondition cond)
|
||||
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;
|
||||
|
||||
assert(s->datalen == 0);
|
||||
@ -203,9 +203,9 @@ static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
|
||||
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);
|
||||
QLIST_REMOVE(s, next);
|
||||
@ -216,9 +216,9 @@ static void spice_chr_free(struct CharDriverState *chr)
|
||||
#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) {
|
||||
vmc_register_interface(s);
|
||||
} 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
|
||||
SpiceCharDriver *s = (SpiceCharDriver *)chr;
|
||||
SpiceChardev *s = (SpiceChardev *)chr;
|
||||
|
||||
if (fe_open) {
|
||||
spice_server_port_event(&s->sin, SPICE_PORT_EVENT_OPENED);
|
||||
@ -256,26 +256,26 @@ static void print_allowed_subtypes(void)
|
||||
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);
|
||||
}
|
||||
|
||||
static CharDriverState *chr_open(const CharDriver *driver,
|
||||
static Chardev *chr_open(const CharDriver *driver,
|
||||
const char *subtype,
|
||||
ChardevCommon *backend,
|
||||
Error **errp)
|
||||
{
|
||||
CharDriverState *chr;
|
||||
SpiceCharDriver *s;
|
||||
Chardev *chr;
|
||||
SpiceChardev *s;
|
||||
|
||||
chr = qemu_chr_alloc(driver, backend, errp);
|
||||
if (!chr) {
|
||||
return NULL;
|
||||
}
|
||||
s = (SpiceCharDriver *)chr;
|
||||
s = (SpiceChardev *)chr;
|
||||
s->active = false;
|
||||
s->sin.subtype = g_strdup(subtype);
|
||||
|
||||
@ -284,7 +284,7 @@ static CharDriverState *chr_open(const CharDriver *driver,
|
||||
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,
|
||||
ChardevBackend *backend,
|
||||
ChardevReturn *ret,
|
||||
@ -312,7 +312,7 @@ static CharDriverState *qemu_chr_open_spice_vmc(const CharDriver *driver,
|
||||
}
|
||||
|
||||
#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,
|
||||
ChardevBackend *backend,
|
||||
ChardevReturn *ret,
|
||||
@ -322,8 +322,8 @@ static CharDriverState *qemu_chr_open_spice_port(const CharDriver *driver,
|
||||
ChardevSpicePort *spiceport = backend->u.spiceport.data;
|
||||
const char *name = spiceport->fqdn;
|
||||
ChardevCommon *common = qapi_ChardevSpicePort_base(spiceport);
|
||||
CharDriverState *chr;
|
||||
SpiceCharDriver *s;
|
||||
Chardev *chr;
|
||||
SpiceChardev *s;
|
||||
|
||||
if (name == NULL) {
|
||||
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;
|
||||
}
|
||||
*be_opened = false;
|
||||
s = (SpiceCharDriver *)chr;
|
||||
s = (SpiceChardev *)chr;
|
||||
s->sin.portname = g_strdup(name);
|
||||
|
||||
return chr;
|
||||
@ -343,7 +343,7 @@ static CharDriverState *qemu_chr_open_spice_port(const CharDriver *driver,
|
||||
|
||||
void qemu_spice_register_ports(void)
|
||||
{
|
||||
SpiceCharDriver *s;
|
||||
SpiceChardev *s;
|
||||
|
||||
QLIST_FOREACH(s, &spice_chars, next) {
|
||||
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 const CharDriver vmc_driver = {
|
||||
.instance_size = sizeof(SpiceCharDriver),
|
||||
.instance_size = sizeof(SpiceChardev),
|
||||
.kind = CHARDEV_BACKEND_KIND_SPICEVMC,
|
||||
.parse = qemu_chr_parse_spice_vmc,
|
||||
.create = qemu_chr_open_spice_vmc,
|
||||
@ -398,7 +398,7 @@ static void register_types(void)
|
||||
.chr_free = spice_chr_free,
|
||||
};
|
||||
static const CharDriver port_driver = {
|
||||
.instance_size = sizeof(SpiceCharDriver),
|
||||
.instance_size = sizeof(SpiceChardev),
|
||||
.kind = CHARDEV_BACKEND_KIND_SPICEPORT,
|
||||
.parse = qemu_chr_parse_spice_port,
|
||||
.create = qemu_chr_open_spice_port,
|
||||
|
@ -11,6 +11,6 @@ int monitor_get_fd(Monitor *mon, const char *name, Error **errp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void monitor_init(CharDriverState *chr, int flags)
|
||||
void monitor_init(Chardev *chr, int flags)
|
||||
{
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ static void fe_event(void *opaque, int event)
|
||||
#ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS
|
||||
static void char_stdio_test_subprocess(void)
|
||||
{
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
CharBackend be;
|
||||
int ret;
|
||||
|
||||
@ -68,7 +68,7 @@ static void char_stdio_test(void)
|
||||
static void char_ringbuf_test(void)
|
||||
{
|
||||
QemuOpts *opts;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
CharBackend be;
|
||||
char *data;
|
||||
int ret;
|
||||
@ -109,7 +109,7 @@ static void char_ringbuf_test(void)
|
||||
static void char_mux_test(void)
|
||||
{
|
||||
QemuOpts *opts;
|
||||
CharDriverState *chr, *base;
|
||||
Chardev *chr, *base;
|
||||
char *data;
|
||||
FeHandler h1 = { 0, }, h2 = { 0, };
|
||||
CharBackend chr_be1, chr_be2;
|
||||
@ -185,7 +185,7 @@ static void char_mux_test(void)
|
||||
static void char_null_test(void)
|
||||
{
|
||||
Error *err = NULL;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
CharBackend be;
|
||||
int ret;
|
||||
|
||||
@ -227,7 +227,7 @@ static void char_null_test(void)
|
||||
|
||||
static void char_invalid_test(void)
|
||||
{
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
chr = qemu_chr_new("label-invalid", "invalid");
|
||||
g_assert_null(chr);
|
||||
|
@ -454,7 +454,7 @@ static void chr_event(void *opaque, int event)
|
||||
static void test_server_create_chr(TestServer *server, const gchar *opt)
|
||||
{
|
||||
gchar *chr_path;
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
chr_path = g_strdup_printf("unix:%s%s", server->socket_path, opt);
|
||||
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)
|
||||
{
|
||||
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_delete(chr);
|
||||
|
40
ui/console.c
40
ui/console.c
@ -158,7 +158,7 @@ struct QemuConsole {
|
||||
int esc_params[MAX_ESC_PARAMS];
|
||||
int nb_esc_params;
|
||||
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
/* fifo for key pressed */
|
||||
QEMUFIFO out_fifo;
|
||||
uint8_t out_fifo_buf[16];
|
||||
@ -183,7 +183,7 @@ static int nb_consoles = 0;
|
||||
static bool cursor_visible_phase;
|
||||
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 DisplayState *get_alloc_displaystate(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;
|
||||
} 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;
|
||||
int i;
|
||||
|
||||
@ -1962,9 +1962,9 @@ int qemu_console_get_height(QemuConsole *con, int 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;
|
||||
|
||||
s->echo = echo;
|
||||
@ -2003,9 +2003,9 @@ static const GraphicHwOps text_console_ops = {
|
||||
.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;
|
||||
int g_width = 80 * FONT_WIDTH;
|
||||
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 CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
|
||||
static Chardev *text_console_init(ChardevVC *vc, Error **errp)
|
||||
{
|
||||
ChardevCommon *common = qapi_ChardevVC_base(vc);
|
||||
CharDriverState *chr;
|
||||
VCDriverState *drv;
|
||||
Chardev *chr;
|
||||
VCChardev *drv;
|
||||
QemuConsole *s;
|
||||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
@ -2099,7 +2099,7 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
|
||||
}
|
||||
|
||||
s->chr = chr;
|
||||
drv = (VCDriverState *)chr;
|
||||
drv = (VCChardev *)chr;
|
||||
drv->console = s;
|
||||
|
||||
if (display_state) {
|
||||
@ -2110,10 +2110,10 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
|
||||
|
||||
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
|
||||
* 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 = {
|
||||
.instance_size = sizeof(VCDriverState),
|
||||
.instance_size = sizeof(VCChardev),
|
||||
.kind = CHARDEV_BACKEND_KIND_VC,
|
||||
.parse = qemu_chr_parse_vc,
|
||||
.create = vc_init,
|
||||
|
26
ui/gtk.c
26
ui/gtk.c
@ -181,11 +181,11 @@ struct GtkDisplayState {
|
||||
bool ignore_keys;
|
||||
};
|
||||
|
||||
typedef struct VCDriverState {
|
||||
CharDriverState parent;
|
||||
typedef struct VCChardev {
|
||||
Chardev parent;
|
||||
VirtualConsole *console;
|
||||
bool echo;
|
||||
} VCDriverState;
|
||||
} VCChardev;
|
||||
|
||||
static void gd_grab_pointer(VirtualConsole *vc, const char *reason);
|
||||
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;
|
||||
|
||||
vte_terminal_feed(VTE_TERMINAL(vc->vte.terminal), (const char *)buf, 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;
|
||||
|
||||
if (vc) {
|
||||
@ -1711,19 +1711,19 @@ static void gd_vc_chr_set_echo(CharDriverState *chr, bool echo)
|
||||
}
|
||||
|
||||
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 = {
|
||||
.instance_size = sizeof(VCDriverState),
|
||||
.instance_size = sizeof(VCChardev),
|
||||
.kind = CHARDEV_BACKEND_KIND_VC,
|
||||
.chr_write = gd_vc_chr_write,
|
||||
.chr_set_echo = gd_vc_chr_set_echo,
|
||||
};
|
||||
|
||||
ChardevCommon *common = qapi_ChardevVC_base(vc);
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
|
||||
if (nb_vcs == MAX_VCS) {
|
||||
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,
|
||||
CharDriverState *chr, int idx,
|
||||
Chardev *chr, int idx,
|
||||
GSList *group, GtkWidget *view_menu)
|
||||
{
|
||||
char buffer[32];
|
||||
GtkWidget *box;
|
||||
GtkWidget *scrollbar;
|
||||
GtkAdjustment *vadjustment;
|
||||
VCDriverState *vcd = (VCDriverState *)chr;
|
||||
VCChardev *vcd = (VCChardev *)chr;
|
||||
|
||||
vc->s = s;
|
||||
vc->vte.echo = vcd->echo;
|
||||
|
10
vl.c
10
vl.c
@ -151,10 +151,10 @@ static int full_screen = 0;
|
||||
static int no_frame = 0;
|
||||
int no_quit = 0;
|
||||
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 singlestep = 0;
|
||||
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)
|
||||
{
|
||||
CharDriverState *chr;
|
||||
Chardev *chr;
|
||||
const char *chardev;
|
||||
const char *mode;
|
||||
int flags;
|
||||
|
@ -9,6 +9,6 @@
|
||||
#include "qemu-common.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)
|
||||
{
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
do { } while (0)
|
||||
#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;
|
||||
char *path = NULL;
|
||||
@ -74,7 +74,7 @@ out:
|
||||
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) {
|
||||
store_dev_info(xen_domid, chr, "/console");
|
||||
|
Loading…
Reference in New Issue
Block a user