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
CP-8629: Run all tests

Do not specify the testfile explicitly, just the directory - nose will
pick up all the test files.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CP-8629: Unit tests for devscan

Add unit tests for devscan.py Also added a test library with useful
helper commands.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-135649: Add additional HBA information to sr-probe and sr-create

There currently is no easy way to gather the basic information about HBAs, that
are required for provisioning external storage.

This commit adds some basic information about the FC and iSCSI HBAs to the
HBA-specific output of "xe sr-probe type=LVMoHBA" and "xe sr-create
type=LVMoHBA" to address this gap.

Signed-off-by: Robert Breker <robert.breker@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-135649: Unit tests

Adding unit tests - devscan.scan will report the parameters if they are
provided by the device driver. Also added some additional logging to
show files not found and files being opened.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Merge branch 'CA-135649' into xs64bit

GitHub: closes #149 on xapi-project/sm