aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-22 12:52:53 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-10-24 15:27:20 +0200
commit7fa47e2a80e1c204533340f65909b7fc7c6b276f (patch)
tree06fa4c2de9409c5d1b3f1ec934f8f1234d4de949
parent32a6ebecd2ffe82ffade5edf9e054e20cb48f281 (diff)
downloadqemu-7fa47e2a80e1c204533340f65909b7fc7c6b276f.zip
qemu-7fa47e2a80e1c204533340f65909b7fc7c6b276f.tar.gz
qemu-7fa47e2a80e1c204533340f65909b7fc7c6b276f.tar.bz2
char: rename some frontend functions
qemu_chr_accept_input() and qemu_chr_disconnect() are only used by frontend, so use qemu_chr_fe prefix. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-14-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/char/bcm2835_aux.c2
-rw-r--r--hw/char/cadence_uart.c4
-rw-r--r--hw/char/escc.c2
-rw-r--r--hw/char/imx_serial.c4
-rw-r--r--hw/char/ipoctal232.c2
-rw-r--r--hw/char/lm32_uart.c2
-rw-r--r--hw/char/mcf_uart.c2
-rw-r--r--hw/char/milkymist-uart.c2
-rw-r--r--hw/char/pl011.c2
-rw-r--r--hw/char/serial.c2
-rw-r--r--hw/char/spapr_vty.c2
-rw-r--r--hw/char/stm32f2xx_usart.c4
-rw-r--r--hw/char/virtio-console.c2
-rw-r--r--hw/char/xilinx_uartlite.c2
-rw-r--r--include/sysemu/char.h6
-rw-r--r--net/vhost-user.c4
-rw-r--r--qemu-char.c4
-rw-r--r--tests/vhost-user-test.c6
18 files changed, 27 insertions, 27 deletions
diff --git a/hw/char/bcm2835_aux.c b/hw/char/bcm2835_aux.c
index 4bc5d02..30f4ea5 100644
--- a/hw/char/bcm2835_aux.c
+++ b/hw/char/bcm2835_aux.c
@@ -80,7 +80,7 @@ static uint64_t bcm2835_aux_read(void *opaque, hwaddr offset, unsigned size)
}
}
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
bcm2835_aux_update(s);
return c;
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index d5687dd..c027235 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -143,7 +143,7 @@ static void uart_rx_reset(CadenceUARTState *s)
s->rx_wpos = 0;
s->rx_count = 0;
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
}
@@ -369,7 +369,7 @@ static void uart_read_rx_fifo(CadenceUARTState *s, uint32_t *c)
s->rx_count--;
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
} else {
*c = 0;
diff --git a/hw/char/escc.c b/hw/char/escc.c
index ae69b39..f1e8fac 100644
--- a/hw/char/escc.c
+++ b/hw/char/escc.c
@@ -600,7 +600,7 @@ static uint64_t escc_mem_read(void *opaque, hwaddr addr,
ret = s->rx;
trace_escc_mem_readb_data(CHN_C(s), ret);
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
return ret;
default:
diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index 5c11de2..2e39d31 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -122,7 +122,7 @@ static uint64_t imx_serial_read(void *opaque, hwaddr offset,
s->uts1 |= UTS1_RXEMPTY;
imx_update(s);
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
}
return c;
@@ -216,7 +216,7 @@ static void imx_serial_write(void *opaque, hwaddr offset,
if (value & UCR2_RXEN) {
if (!(s->ucr2 & UCR2_RXEN)) {
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
}
}
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 0c9dea3..875fe3b 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -289,7 +289,7 @@ static uint16_t io_read(IPackDevice *ip, uint8_t addr)
ch->sr &= ~SR_RXRDY;
blk->isr &= ~ISR_RXRDY(channel);
if (ch->dev.chr) {
- qemu_chr_accept_input(ch->dev.chr);
+ qemu_chr_fe_accept_input(ch->dev.chr);
}
} else {
ch->rhr_idx = (ch->rhr_idx + 1) % RX_FIFO_SIZE;
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index 72fc41c..a8d4a2d 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -142,7 +142,7 @@ static uint64_t uart_read(void *opaque, hwaddr addr,
r = s->regs[R_RXTX];
s->regs[R_LSR] &= ~LSR_DR;
uart_update_irq(s);
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
break;
case R_IIR:
case R_LSR:
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index 436e1b0..57b47c6 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -93,7 +93,7 @@ uint64_t mcf_uart_read(void *opaque, hwaddr addr,
if (s->fifo_len == 0)
s->sr &= ~MCF_UART_RxRDY;
mcf_uart_update(s);
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
return val;
}
case 0x10:
diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index a6518e6..c75bcb5 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -138,7 +138,7 @@ static void uart_write(void *opaque, hwaddr addr, uint64_t value,
case R_STAT:
/* write one to clear bits */
s->regs[addr] &= ~(value & (STAT_RX_EVT | STAT_TX_EVT));
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
break;
default:
diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index 9645195..29fb725 100644
--- a/hw/char/pl011.c
+++ b/hw/char/pl011.c
@@ -88,7 +88,7 @@ static uint64_t pl011_read(void *opaque, hwaddr offset,
s->rsr = c >> 8;
pl011_update(s);
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
r = c;
break;
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 18c7482..4489bf1 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -490,7 +490,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr addr, unsigned size)
serial_update_irq(s);
if (!(s->mcr & UART_MCR_LOOP)) {
/* in loopback mode, don't receive any data */
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
}
break;
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index dcb4a85..7afc6a5 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -51,7 +51,7 @@ static int vty_getchars(VIOsPAPRDevice *sdev, uint8_t *buf, int max)
buf[n++] = dev->buf[dev->out++ % VTERM_BUFSIZE];
}
- qemu_chr_accept_input(dev->chardev.chr);
+ qemu_chr_fe_accept_input(dev->chardev.chr);
return n;
}
diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usart.c
index 8cc2737..8619d10 100644
--- a/hw/char/stm32f2xx_usart.c
+++ b/hw/char/stm32f2xx_usart.c
@@ -98,7 +98,7 @@ static uint64_t stm32f2xx_usart_read(void *opaque, hwaddr addr,
retvalue = s->usart_sr;
s->usart_sr &= ~USART_SR_TC;
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
return retvalue;
case USART_DR:
@@ -106,7 +106,7 @@ static uint64_t stm32f2xx_usart_read(void *opaque, hwaddr addr,
s->usart_sr |= USART_SR_TXE;
s->usart_sr &= ~USART_SR_RXNE;
if (s->chr.chr) {
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
}
qemu_set_irq(s->irq, 0);
return s->usart_dr & 0x3FF;
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index a4730ba..93acbec 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -123,7 +123,7 @@ static void guest_writable(VirtIOSerialPort *port)
VirtConsole *vcon = VIRTIO_CONSOLE(port);
if (vcon->chr.chr) {
- qemu_chr_accept_input(vcon->chr.chr);
+ qemu_chr_fe_accept_input(vcon->chr.chr);
}
}
diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c
index 0e809d5..185c63b 100644
--- a/hw/char/xilinx_uartlite.c
+++ b/hw/char/xilinx_uartlite.c
@@ -107,7 +107,7 @@ uart_read(void *opaque, hwaddr addr, unsigned int size)
s->rx_fifo_len--;
uart_update_status(s);
uart_update_irq(s);
- qemu_chr_accept_input(s->chr.chr);
+ qemu_chr_fe_accept_input(s->chr.chr);
break;
default:
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index c518c2f..5881094 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -165,11 +165,11 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename);
/**
- * @qemu_chr_disconnect:
+ * @qemu_chr_fe_disconnect:
*
* Close a fd accpeted by character backend.
*/
-void qemu_chr_disconnect(CharDriverState *chr);
+void qemu_chr_fe_disconnect(CharDriverState *chr);
/**
* @qemu_chr_cleanup:
@@ -490,7 +490,7 @@ void qemu_chr_add_handlers_full(CharDriverState *s,
GMainContext *context);
void qemu_chr_be_generic_open(CharDriverState *s);
-void qemu_chr_accept_input(CharDriverState *s);
+void qemu_chr_fe_accept_input(CharDriverState *s);
int qemu_chr_add_client(CharDriverState *s, int fd);
CharDriverState *qemu_chr_find(const char *name);
bool chr_is_ringbuf(const CharDriverState *chr);
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 957459f..4578247 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -187,7 +187,7 @@ static gboolean net_vhost_user_watch(GIOChannel *chan, GIOCondition cond,
{
VhostUserState *s = opaque;
- qemu_chr_disconnect(s->chr.chr);
+ qemu_chr_fe_disconnect(s->chr.chr);
return FALSE;
}
@@ -212,7 +212,7 @@ static void net_vhost_user_event(void *opaque, int event)
s->watch = qemu_chr_fe_add_watch(s->chr.chr, G_IO_HUP,
net_vhost_user_watch, s);
if (vhost_user_start(queues, ncs) < 0) {
- qemu_chr_disconnect(s->chr.chr);
+ qemu_chr_fe_disconnect(s->chr.chr);
return;
}
qmp_set_link(name, true, &err);
diff --git a/qemu-char.c b/qemu-char.c
index 9eefa7f..2c26839 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -430,7 +430,7 @@ int qemu_chr_add_client(CharDriverState *s, int fd)
return s->chr_add_client ? s->chr_add_client(s, fd) : -1;
}
-void qemu_chr_accept_input(CharDriverState *s)
+void qemu_chr_fe_accept_input(CharDriverState *s)
{
if (s->chr_accept_input)
s->chr_accept_input(s);
@@ -4225,7 +4225,7 @@ void qemu_chr_fe_release(CharDriverState *s)
s->avail_connections++;
}
-void qemu_chr_disconnect(CharDriverState *chr)
+void qemu_chr_fe_disconnect(CharDriverState *chr)
{
if (chr->chr_disconnect) {
chr->chr_disconnect(chr);
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 52fbc03..6e5383d 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -268,7 +268,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
int fd;
if (s->test_fail) {
- qemu_chr_disconnect(chr->chr);
+ qemu_chr_fe_disconnect(chr->chr);
/* now switch to non-failure */
s->test_fail = false;
}
@@ -313,7 +313,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
g_assert_cmpint(msg.payload.u64 & (0x1ULL << VHOST_USER_F_PROTOCOL_FEATURES),
!=, 0ULL);
if (s->test_flags == TEST_FLAGS_DISCONNECT) {
- qemu_chr_disconnect(chr->chr);
+ qemu_chr_fe_disconnect(chr->chr);
s->test_flags = TEST_FLAGS_BAD;
}
break;
@@ -724,7 +724,7 @@ reconnect_cb(gpointer user_data)
{
TestServer *s = user_data;
- qemu_chr_disconnect(s->chr.chr);
+ qemu_chr_fe_disconnect(s->chr.chr);
return FALSE;
}