#include <sys/times.h>
#include <sys/wait.h>
#include <termios.h>
-#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/socket.h>
s->avail_connections++;
}
+void qemu_chr_disconnect(CharDriverState *chr)
+{
+ if (chr->chr_disconnect) {
+ chr->chr_disconnect(chr);
+ }
+}
+
static void qemu_chr_free_common(CharDriverState *chr)
{
g_free(chr->filename);
return NULL;
}
-/* Get a character (serial) device interface. */
-CharDriverState *qemu_char_get_next_serial(void)
-{
- static int next_serial;
- CharDriverState *chr;
-
- /* FIXME: This function needs to go away: use chardev properties! */
-
- while (next_serial < MAX_SERIAL_PORTS && serial_hds[next_serial]) {
- chr = serial_hds[next_serial++];
- qemu_chr_fe_claim_no_fail(chr);
- return chr;
- }
- return NULL;
-}
-
QemuOptsList qemu_chardev_opts = {
.name = "chardev",
.implied_opt_name = "backend",
chr->chr_write = tcp_chr_write;
chr->chr_sync_read = tcp_chr_sync_read;
chr->chr_close = tcp_chr_close;
+ chr->chr_disconnect = tcp_chr_disconnect;
chr->get_msgfds = tcp_get_msgfds;
chr->set_msgfds = tcp_set_msgfds;
chr->chr_add_client = tcp_chr_add_client;