CA-116545: SR detach could fail during a Find Open process check

This could happen if one pid, out of a list of pids, cease to exist.
Ignoring the error helps us move forward through the list checking
for any pid / file handles

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

(cherry picked from commit 91c4e20eb09c21f715b3d9539d961963a74dd589)

GitHub: closes #129 on xapi-project/sm
CA-136654: Don't rely on a XAPI session existing

With static VDIs, the SR code is run without a XAPI session.  In this
case, set O_DIRECT to be on for safety since there is external knob to
adjust it.

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

GitHub: closes #142 on xapi-project/sm
CA-116160: Python exception in HBA SR create.

len() on dictionary iterkeys is not valid in Python 2.6.
Replaced it with len() directly on the dictionary.

Signed-off-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>

(cherry picked from commit e7720d8e83a24b61eb52885dae0027fd3f803c58)
Imported-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #144 on xapi-project/sm