From: Ronnie Sahlberg <ronniesahlberg@gmail.com>
To: qemu-devel@nongnu.org, kwolf@redhat.com
Subject: [Qemu-devel] [PATCH 0/1] ISCSI: Only set read-event if we have i/o in flight
Date: Fri, 11 May 2012 20:22:01 +1000 [thread overview]
Message-ID: <1336731722-17743-1-git-send-email-ronniesahlberg@gmail.com> (raw)
List, Kevin
Please find a small patch to the iscsi driver to only set the fd handler for read events IF we have i/o in flight and we are thus waiting for replies coming back from the target.
There are situations where qemu_aio_set_fd_handler(fd, read_callback, ...
will invoke the read_callback even if there is no fd/socket error and there are
also no bytes to read from the descriptor.
This interacts bad with libiscsi which when invoked for POLLIN assumes that there is data to read and if ioctl(...FIONREAD...) returns 0 bytes that this indicates a socket failure/error/closure.
I dont know if that is expected behaviour from qemu_aio_set_fd_handler or not,
but aside from target-initiated NOPs, we shouldnt expect there to be any reason to read from the socket anyway unless we have i/o in flight and are waiting for replies, so this would also avoid eating some cpu invoking the read_callback when falsely.
regards
ronnie sahlberg
next reply other threads:[~2012-05-11 10:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 10:22 Ronnie Sahlberg [this message]
2012-05-11 10:22 ` [Qemu-devel] [PATCH] ISCSI: Only set up the read-event if we are actually waiting for data to come back in from the target Ronnie Sahlberg
2012-05-11 11:27 ` Paolo Bonzini
2012-05-11 12:39 ` ronnie sahlberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336731722-17743-1-git-send-email-ronniesahlberg@gmail.com \
--to=ronniesahlberg@gmail.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).