[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/43] qemu-char: move pty_chr_update_read_handler ar
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 40/43] qemu-char: move pty_chr_update_read_handler around |
Date: |
Mon, 23 Jun 2014 12:36:40 -0400 |
From: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
qemu-char.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 28ea9f2..9961b02 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1101,6 +1101,22 @@ static void pty_chr_rearm_timer(CharDriverState *chr,
int ms)
}
}
+static void pty_chr_update_read_handler(CharDriverState *chr)
+{
+ PtyCharDriver *s = chr->opaque;
+ GPollFD pfd;
+
+ pfd.fd = g_io_channel_unix_get_fd(s->fd);
+ pfd.events = G_IO_OUT;
+ pfd.revents = 0;
+ g_poll(&pfd, 1, 0);
+ if (pfd.revents & G_IO_HUP) {
+ pty_chr_state(chr, 0);
+ } else {
+ pty_chr_state(chr, 1);
+ }
+}
+
static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
{
PtyCharDriver *s = chr->opaque;
@@ -1153,22 +1169,6 @@ static gboolean pty_chr_read(GIOChannel *chan,
GIOCondition cond, void *opaque)
return TRUE;
}
-static void pty_chr_update_read_handler(CharDriverState *chr)
-{
- PtyCharDriver *s = chr->opaque;
- GPollFD pfd;
-
- pfd.fd = g_io_channel_unix_get_fd(s->fd);
- pfd.events = G_IO_OUT;
- pfd.revents = 0;
- g_poll(&pfd, 1, 0);
- if (pfd.revents & G_IO_HUP) {
- pty_chr_state(chr, 0);
- } else {
- pty_chr_state(chr, 1);
- }
-}
-
static void pty_chr_state(CharDriverState *chr, int connected)
{
PtyCharDriver *s = chr->opaque;
--
1.9.3
- [Qemu-devel] [PULL 27/43] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR, (continued)
- [Qemu-devel] [PULL 27/43] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 26/43] qapi event: convert DEVICE_TRAY_MOVED, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 32/43] qapi event: convert SPICE events, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 28/43] qapi event: convert BLOCK_IMAGE_CORRUPTED, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 30/43] qapi event: convert NIC_RX_FILTER_CHANGED, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 31/43] qapi event: convert VNC events, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 33/43] qmp: convert ACPI_DEVICE_OST event, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 35/43] qapi event: convert GUEST_PANICKED, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 36/43] qapi event: convert QUORUM events, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 38/43] qemu-char: introduce qemu_chr_alloc, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 40/43] qemu-char: move pty_chr_update_read_handler around,
Luiz Capitulino <=
- [Qemu-devel] [PULL 05/43] qapi: Suppress unwanted space between type and identifier, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 41/43] qemu-char: make writes thread-safe, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 04/43] qapi: add const prefix to 'char *' insider c_type(), Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 10/43] qapi script: add event support, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 34/43] qapi event: convert BALLOON_CHANGE, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 25/43] qapi event: convert DEVICE_DELETED, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 16/43] qapi event: convert POWERDOWN, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 29/43] qapi event: convert other BLOCK_JOB events, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 09/43] qapi: add event helper functions, Luiz Capitulino, 2014/06/23
- [Qemu-devel] [PULL 19/43] qapi event: convert RESUME, Luiz Capitulino, 2014/06/23