block/iscsi: handle zero events from iscsi_which_events
commit05b685fbabb7fdcab72cb42b27db916fd74b2265
authorPeter Lieven <pl@kamp.de>
Tue, 7 Apr 2015 20:08:15 +0000 (7 22:08 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 9 Apr 2015 09:31:45 +0000 (9 10:31 +0100)
treef2446f518d780be7921321c30c6ad4d787a7e5ef
parente8d3b1a25f284cdf9705b7cf0412281cc9ee3a36
block/iscsi: handle zero events from iscsi_which_events

newer libiscsi versions may return zero events from iscsi_which_events.

In this case iscsi_service will return immediately without any progress.
To avoid busy waiting for iscsi_which_events to change we deregister all
read and write handlers in this case and schedule a timer to periodically
check iscsi_which_events for changed events.

Next libiscsi version will introduce async reconnects and zero events
are returned while libiscsi is waiting for a reconnect retry.

Signed-off-by: Peter Lieven <pl@kamp.de>
Message-id: 1428437295-29577-1-git-send-email-pl@kamp.de
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/iscsi.c