KVM test: kvm_subprocess: use select() in read_until_output_matches()

Currently read_nonblocking() is called repeatedly until a match is found.
This is fine as long as internal_timeout, the timeout parameter passed to
read_nonblocking(), is greater than zero.  If it equals zero the loop will keep
the CPU busy and stress the host.
To avoid this, use select() to wait until there's output to read from the child
process.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3798 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed