CA-140334: don't complain when tapdisk control socket doesn't exist

tapdisks may be destroyed at any time by the SM, therefore their control
socket might disappear abruptly. This is expected and complaining about
innocuous errors like that complicates debugging.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>

GitHub: closes #101 on xapi-project/blktap
CA-135774: Properly log when low memory handler is not available

Use EPRINTF rather than ERR when logging if the low memory handler is not
available because it is initialized before ERR logging is set up.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>

GitHub: closes #112 on xapi-project/blktap
CA-141740: don't overwrite requests not yet submitted

When submitting requests we use a sub-array of the free requests. This
is problematic because if one request fails (e.g. because the grant-copy
failed while serving a write request) we immediately complete the
request, and completing the requests means that we put it back on the
part of the array designated to hold free requests. However, putting
back the request overwrites part of the sub-array designated to the
not-yet-submitted requests, which leads to corruption.

Operating on a copy of the sub-array of the requests to be submitted
addresses the issue.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #115 on xapi-project/blktap
CA-137990: allow ring disconnection with pending requests

This patch allows disconnecting from the ring even though there are
pending requests. This allows the front-end to close and re-open then
ring when necessary (e.g. I/O is slow and the front-end is told to reset
itself) without having to wait for these requests to complete, as
cancelling requests is not supported by Xenbus.

Rings with pending requests aren't immediately destroyed (that's
impossible), but are marked as dead. Requests completing against dead
rings are cleaned up and the last pending requests truly destroys the
ring. There can be multiple dead rings.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-137990: include ring ID in messages

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-137990: include request ID in log messages

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-140031: wait for dead rings to die before closing VBD

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-140031: use list of currently active rings

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-137990: address review comments

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