vmm: Exit console input thread if we get EOF on stdin
authorDan Cross <crossd@gmail.com>
Mon, 14 Aug 2017 18:06:14 +0000 (14:06 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 14 Aug 2017 21:00:32 +0000 (17:00 -0400)
commitccef4025fd754e4bca84eac99f89e82ec12ada2f
tree4ddbcbe623bd6e6fe5b90244fda6f59ecfa1fbee
parent35cc026dc354164086324e24a5502aa27c6feacf
vmm: Exit console input thread if we get EOF on stdin

If we read an EOF from standard input (that is,
read() returns 0) then take that as a signal that
we should exit the console input loop, instead of
injecting console input interrupts into the guest
when there is nothing to read.

Tested by booting Linux and seeing a reduction
from a core spending approximately 85% of its time
in hardware interrupt handling down to spending
a single-digit percentage of time handling
interrupts.

Change-Id: Idb0a82ab9eab86c10f0e2169c008de236fe4e71d
Signed-off-by: Dan Cross <crossd@gmail.com>
[Added vmm:]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/vmm/virtio_lguest_console.c