CA-88376: Reset the nbd_mirror_failed flag when disabling mirroring

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
fixed passing bdev read only flag to blktap2 kernel module
CA-90801: add option to skip block overlap check

Checking for block overlap is O(n^2) in the number of VHD blocks and can take
minutes for very large VHDs, which cannot be afforded during leaf-coalesce
while the tapdisk is paused.
Fix the "does break strict-aliasing rules" warning

This warning breaks the standalone compilation because of -Werror.
CA-98950: fix coalescing with small ancestors.

When the virtual size of the coalesce target's ancestors (grandparent & above,
since the parent's size must match the target's) is smaller (due to a resize),
vhd-util coalesce might incorrectly error out with ERANGE when reading a
sector(s) in a partial block beyond the smaller ancestor's size.
XOP-289: use UTC for VHD timestamps

Currently, the local timezone is factored into VHD timestamps due to the use of
mktime(). This breaks "vhd-util check" for VHDs created in one timezone and
then moved westward, which results in "primary footer invalid: creation time in
future" errors.
CA-108155: Return EIO when the extent sector offset wraps around

    Import: trunk/blktap 751ea7f306fb107e98f1c2abbcb7f02e0bc854c5
    Imported-by: vineetht
    Merge-ticket: CA-118474
CA-108155: Fixed missing definition of ULLOG_MAX in our uclibc

Signed-off-by: Germano Percossi <germano.percossi@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>

    Import: trunk/blktap 8dc993fe8930c4d16ab96ac7f9b6832fb2e9d3b5
    Imported-by: vineetht
    Merge-ticket: CA-118474
CA-108155: fix 64-bit compilation

    Import: trunk/blktap 6ec5bc0002b966be7d9989564940908a322504e9
    Imported-by: vineetht
    Merge-ticket: CA-118474
CP-6999: Allow coalescing to out-of-chain parents.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Keith Petley <keith.petley@citrix.com>

GitHub: closes #63 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-130606: move PAGE_XXX symbols into libtapdisk

Symbols PAGE_MASK, PAGE_SIZE, and PAGE_SHIFT are defined in tapdisk2.c
which is not compiled into libtapdisk, hence these symbols do not get
defined in the library and that obviously doesn't link.

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

GitHub: closes #78 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>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>

GitHub: closes #76 on xapi-project/blktap