return chr->chr_add_watch(chr, cond);
}
-static void mux_chr_close(struct CharDriverState *chr)
+static void mux_chr_free(struct CharDriverState *chr)
{
MuxDriver *d = chr->opaque;
int i;
chr->opaque = d;
d->focus = -1;
- chr->chr_close = mux_chr_close;
+ chr->chr_free = mux_chr_free;
chr->chr_write = mux_chr_write;
chr->chr_accept_input = mux_chr_accept_input;
/* Frontend guest-open / -close notification is not support with muxes */
}
}
-static void fd_chr_close(struct CharDriverState *chr)
+static void fd_chr_free(struct CharDriverState *chr)
{
FDCharDriver *s = chr->opaque;
chr->chr_add_watch = fd_chr_add_watch;
chr->chr_write = fd_chr_write;
chr->chr_update_read_handler = fd_chr_update_read_handler;
- chr->chr_close = fd_chr_close;
+ chr->chr_free = fd_chr_free;
return chr;
}
tcsetattr (0, TCSANOW, &tty);
}
-static void qemu_chr_close_stdio(struct CharDriverState *chr)
+static void qemu_chr_free_stdio(struct CharDriverState *chr)
{
term_exit();
- fd_chr_close(chr);
+ fd_chr_free(chr);
}
static CharDriverState *qemu_chr_open_stdio(const char *id,
if (!chr) {
return NULL;
}
- chr->chr_close = qemu_chr_close_stdio;
+ chr->chr_free = qemu_chr_free_stdio;
chr->chr_set_echo = qemu_chr_set_echo_stdio;
if (opts->has_signal) {
stdio_allow_signal = opts->signal;
}
}
-static void pty_chr_close(struct CharDriverState *chr)
+static void pty_chr_free(struct CharDriverState *chr)
{
PtyCharDriver *s = chr->opaque;
chr->opaque = s;
chr->chr_write = pty_chr_write;
chr->chr_update_read_handler = pty_chr_update_read_handler;
- chr->chr_close = pty_chr_close;
+ chr->chr_free = pty_chr_free;
chr->chr_add_watch = pty_chr_add_watch;
chr->explicit_be_open = true;
return 0;
}
-static void qemu_chr_close_tty(CharDriverState *chr)
+static void qemu_chr_free_tty(CharDriverState *chr)
{
- fd_chr_close(chr);
+ fd_chr_free(chr);
}
static CharDriverState *qemu_chr_open_tty_fd(int fd,
return NULL;
}
chr->chr_ioctl = tty_serial_ioctl;
- chr->chr_close = qemu_chr_close_tty;
+ chr->chr_free = qemu_chr_free_tty;
return chr;
}
#endif /* __linux__ || __sun__ */
return 0;
}
-static void pp_close(CharDriverState *chr)
+static void pp_free(CharDriverState *chr)
{
ParallelCharDriver *drv = chr->opaque;
int fd = drv->fd;
chr->opaque = drv;
chr->chr_write = null_chr_write;
chr->chr_ioctl = pp_ioctl;
- chr->chr_close = pp_close;
+ chr->chr_free = pp_free;
drv->fd = fd;
drv->mode = IEEE1284_MODE_COMPAT;
static int win_chr_poll(void *opaque);
static int win_chr_pipe_poll(void *opaque);
-static void win_chr_close(CharDriverState *chr)
+static void win_chr_free(CharDriverState *chr)
{
WinCharState *s = chr->opaque;
return 0;
fail:
- win_chr_close(chr);
+ win_chr_free(chr);
return -1;
}
s = g_new0(WinCharState, 1);
chr->opaque = s;
chr->chr_write = win_chr_write;
- chr->chr_close = win_chr_close;
+ chr->chr_free = win_chr_free;
if (win_chr_init(chr, filename, errp) < 0) {
g_free(s);
return 0;
fail:
- win_chr_close(chr);
+ win_chr_free(chr);
return -1;
}
s = g_new0(WinCharState, 1);
chr->opaque = s;
chr->chr_write = win_chr_write;
- chr->chr_close = win_chr_close;
+ chr->chr_free = win_chr_free;
if (win_chr_pipe_init(chr, filename, errp) < 0) {
g_free(s);
}
}
-static void win_stdio_close(CharDriverState *chr)
+static void win_stdio_free(CharDriverState *chr)
{
WinStdioCharState *stdio = chr->opaque;
chr->opaque = stdio;
chr->chr_write = win_stdio_write;
- chr->chr_close = win_stdio_close;
+ chr->chr_free = win_stdio_free;
if (is_console) {
if (qemu_add_wait_object(stdio->hStdIn,
}
}
-static void udp_chr_close(CharDriverState *chr)
+static void udp_chr_free(CharDriverState *chr)
{
NetCharDriver *s = chr->opaque;
chr->opaque = s;
chr->chr_write = udp_chr_write;
chr->chr_update_read_handler = udp_chr_update_read_handler;
- chr->chr_close = udp_chr_close;
+ chr->chr_free = udp_chr_free;
/* be isn't opened until we get a connection */
chr->explicit_be_open = true;
return chr;
return qemu_chr_wait_connected(be->chr, errp);
}
-static void tcp_chr_close(CharDriverState *chr)
+static void tcp_chr_free(CharDriverState *chr)
{
TCPCharDriver *s = chr->opaque;
return i;
}
-static void ringbuf_chr_close(struct CharDriverState *chr)
+static void ringbuf_chr_free(struct CharDriverState *chr)
{
RingBufCharDriver *d = chr->opaque;
chr->opaque = d;
chr->chr_write = ringbuf_chr_write;
- chr->chr_close = ringbuf_chr_close;
+ chr->chr_free = ringbuf_chr_free;
return chr;
void qemu_chr_free(CharDriverState *chr)
{
- if (chr->chr_close) {
- chr->chr_close(chr);
+ if (chr->chr_free) {
+ chr->chr_free(chr);
}
qemu_chr_free_common(chr);
}
chr->chr_wait_connected = tcp_chr_wait_connected;
chr->chr_write = tcp_chr_write;
chr->chr_sync_read = tcp_chr_sync_read;
- chr->chr_close = tcp_chr_close;
+ chr->chr_free = tcp_chr_free;
chr->chr_disconnect = tcp_chr_disconnect;
chr->get_msgfds = tcp_get_msgfds;
chr->set_msgfds = tcp_set_msgfds;