CA-135531: fix control socket for slaves

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

GitHub: closes #81 on xapi-project/blktap
CAR-1442: Allow opening read-only VDIs without O_DIRECT

Teach tap-ctl open the "-D" command-line argument.  When "-D" is given,
read-only VHDs are opened without O_DIRECT.

Opening VDIs without O_DIRECT allows the kernel's page to be used, potentially
improving performance.  To prevent the kernel doing readahead and negating some
of the performance benefits of caching, tell the kernel that access to the VDI
fd is random (this makes it not do prefetching, just like if O_DIRECT were
used).

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@citrix.com>

GitHub: closes #80 on xapi-project/blktap
CA-135194: use better names for XenStore watch tokens

helps debugging

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

GitHub: closes #82 on xapi-project/blktap
CA-135194: fix resource clean up in error path

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

GitHub: closes #82 on xapi-project/blktap
CA-134745: read device-type and mode on physical-device callback

This is how blkback does it.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-134745: don't write info on physical-device callback

This write appears redundant as we already do so when connecting to the
front-end (connect_frontend), just like blktap does.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-134745: simplify and clarify reconnect logic

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-134745: ensure frontend() is called before physdev/hotplug.

Functions physical_device_changed() and hotplug_status_changed() require the
front-end path in the VBD to have been initialised, this patch ensures
that frontend() has been called before any of these functions are
called.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Merge branch 'CA-134745' into xs64bit

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

GitHub: closes #85 on xapi-project/blktap