virtio: console: Add support for nonblocking write()s
authorAmit Shah <amit.shah@redhat.com>
Thu, 20 May 2010 04:15:50 +0000 (22:15 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 19 May 2010 12:45:50 +0000 (22:15 +0930)
commitcdfadfc1adb87fc7e8a631b1f299715feacbde90
treefc7ace0ea80df94ed85176c493d9ae341f146b9d
parent60caacd3eeab68672961e88db01e26735527d521
virtio: console: Add support for nonblocking write()s

If the host port is not open, a write() should either just return if the
file is opened in non-blocking mode, or block till the host port is
opened.

Also, don't spin till host consumes data for nonblocking ports. For
non-blocking ports, we can do away with the spinning and reclaim the
buffers consumed by the host on the next write call or on the condition
that'll make poll return.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c