From fa6dce3c8cfe718a0ed54e08d6ae384c5185ca6c Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Thu, 26 Aug 2010 05:41:57 +0530 Subject: auto-virtserial: Add test for testing SIGIO on new data The guest process should receive a SIGIO on not only host connect/disconnect events, but also on new data arrival on the port. Signed-off-by: Amit Shah --- auto-virtserial.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/auto-virtserial.c b/auto-virtserial.c index 811bfd5..b064a98 100644 --- a/auto-virtserial.c +++ b/auto-virtserial.c @@ -1245,6 +1245,14 @@ static int test_sigio_handler(int nr) err = result(__func__, true, "open", ret, POLLOUT, POLLOUT, OP_EQ, true); + /* Write something; guest should receive a POLLIN SIGIO */ + write(chardevs[nr].sock, &ret, sizeof(ret)); + + ret = guest_get_sigio_poll_result(nr); + err = result(__func__, true, "in", + ret, POLLIN|POLLOUT, POLLIN|POLLOUT, OP_EQ, true); + + guest_read(nr, sizeof(ret)); host_close_chardev(nr); sleep(2); -- cgit