CA-124991: Produce v1 RRDs for I/O errors and next VHD block

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>

GitHub: closes #66 on xapi-project/blktap
Merge from blktap2

Conflicts:
	drivers/Makefile.am
	drivers/tapdisk-vbd.c
	drivers/tapdisk-vbd.h

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Merge pull request #70 from tmakatos/blktap3

CP-7835: merge blktap3
CA-130371: don't die of footer/header VHD size mismatch

There's no need to kill tapdisk via an assertion failure in this case as
there might be an intermittent storage error.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>

GitHub: closes #71 on xapi-project/blktap
CA-126139: additional debugging

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-126139: don't check for non-NULL-terminated XenStore values

According to the documentation of xs_read the string returned contains
the NULL-terminating character, so we replace the handling of that
scenario with a simple sanity check.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Merge CA-126139

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

GitHub: closes #72 on xapi-project/blktap
CA-128503: remove erroneous ASSERTs

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-128503: use size of structure instead size of ptr for memcpy

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-128503: don't use memory after free

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-128503: rationalise error code sign

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-128503: sanitise input from XenStore

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-128503: don't use uninitialised variable

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-128503: don't pass -ve to strerror for reporting gcopy errors

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Merge CA-128503

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

GitHub: closes #77 on xapi-project/blktap
CA-128872: suspend ring operation on VBD pause

Pausing the VBD without suspending the operation of the ring leads to
requests being extracted from the ring but not being submitted as the
VBD is paused. The problem in that behaviour is that in SXM tapdisk is
paused before it is closed, so there are requests trapped in tapdisk.
Suspending the operation of the ring when pausing the VBD ensures the
ring is flushed and no requests are extracted from the ring while the
VBD is paused.

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