CA-141611: check ring unmap return value

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-141611: introduce check ring event

This patch introduces the check ring event. This allows scheduling an
event for checking the ring for new requests independent of event
channel notifications.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
CA-141611: break on barrier request

This patch introduces part of write I/O barrier functionality. When we
check the ring for requests, if we encounter a barrier request we
immediately stop extracting requests from the ring and mask the event
associated with checking the ring in order to avoid submitting new I/O
requests.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
CA-141611: complete barrier when all pending requests complete

This patch adds the rest of the functionality required for write I/O
barriers. When a request completes, we check whether there is a pending
barrier request and if so we complete it and schedule the event that
checks the ring for requests.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
CA-144705: use correct depth when destroying dead rings

Take care when completing a barrier request of dead ring because the
completion function is recursively called.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-141611: advertise write I/O barriers in Xenbus

blkback advertises I/O write barriers for CD-ROM devices as well, and so
do we.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>