From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35947 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNjOi-0006tU-Uq for qemu-devel@nongnu.org; Wed, 01 Dec 2010 04:54:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNjOh-0007Cc-L1 for qemu-devel@nongnu.org; Wed, 01 Dec 2010 04:54:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNjOh-0007CV-Dh for qemu-devel@nongnu.org; Wed, 01 Dec 2010 04:54:47 -0500 From: Amit Shah Date: Wed, 1 Dec 2010 15:24:22 +0530 Message-Id: Subject: [Qemu-devel] [PATCH v8 0/7] char: non-blocking writes, virtio-console flow control List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Amit Shah , Gerd Hoffmann , Juan Quintela Hello, This refreshed series adds support for non-blocking chardev writes if the caller asks for it. This series does away with the special qemu_chr_write_nb() call that did nonblocking writes. Instead, now the writes are nonblocking if the caller registers a callback function with the chardev that indicates a driver became writable. Individual drivers too have to be modified a bit to update their fd handlers for nonblocking writes to work. This series has non-blocking support for the unix and tcp drivers. The virtio-console code is tweaked to use this facility. This helps a fast guest slow down in case of a slow host reader. The worst-case condition was a guest writing data to a chardev that wasn't being read from resulting in the guest getting unresponsive. Amit Shah (7): virtio-console: Factor out common init between console and generic ports char: Add a QemuChrHandlers struct to initialise chardev handlers char: Introduce char_set/remove_fd_handlers() char: Add framework for a 'write unblocked' callback char: Update send_all() to handle nonblocking chardev write requests char: Equip the unix/tcp backend to handle nonblocking writes virtio-console: Enable port throttling when chardev is slow to consume data gdbstub.c | 9 ++- hw/debugcon.c | 2 +- hw/escc.c | 9 ++- hw/etraxfs_ser.c | 13 +++- hw/ivshmem.c | 28 ++++++-- hw/mcf_uart.c | 9 ++- hw/pl011.c | 9 ++- hw/pxa2xx.c | 13 +++- hw/serial.c | 9 ++- hw/sh_serial.c | 12 +++- hw/syborg_serial.c | 9 ++- hw/usb-serial.c | 9 ++- hw/virtio-console.c | 53 +++++++++----- hw/xen_console.c | 16 +++-- hw/xilinx_uartlite.c | 11 +++- monitor.c | 19 ++++- net/slirp.c | 8 ++- net/socket.c | 4 +- qemu-char.c | 190 ++++++++++++++++++++++++++++++++++++++++---------- qemu-char.h | 17 ++++- qemu_socket.h | 2 +- 21 files changed, 343 insertions(+), 108 deletions(-) -- 1.7.3.2