Pin coverage's version

Coverage 4 appeared on pypi, which is not compatible with old python
interpreters. Pinning coverage to 3.7.1

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Reviewed-by: Flavien Quesnel <flavien.quesnel@citrix.com>

GitHub: closes #225 on xapi-project/sm
Revert "Merge CA-145685 into xs64bit"

This reverts commit e409963be9a44636fb2a4ade304bbb2d3e4056bc, reversing
changes made to b4fa67284dd6a14dde5982d1a5934e7ff816964e.

Signed-off-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-145685: Create a tap disk to pass the host DVD drive to a PV guest

More robust version. Supersedes commit 050d45de

Signed-off-by: Flavien Quesnel <flavien.quesnel@citrix.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>
CA-145685: [UnitTest] Add unit tests

Supersedes commit 801f9e9c

Signed-off-by: Flavien Quesnel <flavien.quesnel@citrix.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>
Merge CA-145685 into xs64bit (new version)

Signed-off-by: Germano Percossi <germano.percossi@citrix.com>

GitHub: closes #226 on xapi-project/sm
CA-147816: Create a tap disk for every kind of udev device

Commit a121c306 was about creating a tap disk when passing a physical
cd device to a guest.
For that purpose, we checked that the value of sr.sm_config['type'] was
equal to 'cd'.

With CA-147816, we also want a tap disk in case of a USB device.
However, sr.sm_config['type'] is equal to 'block' in this case, which
may be too general; for instance, we do not want to create a tap disk
for a storage array.
Moreover, there is no easy way to know that we are dealing with a USB
device.

According to the XenServer 6.2 administration guide, a udev SR only
handles cd and usb devices.
This fix relies on this assumption, since a tap disk is now created if
the SR handles udev devices.

Signed-off-by: Flavien Quesnel <flavien.quesnel@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-147816: [UnitTest] Update and refactor unit tests

Update and refactor unit tests introduced by 3060073a to reflect the
changes from a121c306 to c0f26bf4.

Signed-off-by: Flavien Quesnel <flavien.quesnel@citrix.com>
Merge branch 'CA-147816' into xs64bit

Signed-off-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>

GitHub: closes #228 on xapi-project/sm
CA-129230: Output of SM is truncated in logs (by syslog)

Problem: If an exception other than SR.SRException was raised in
SRCommand.run(), it was only caught and logged into SMlog by LVHD.
All other SR drivers let it pass to xapi, which in turn truncated
the traceback / exception message, making it difficult to debug.

Fix: There is now a single, driver agnostic point inside
SRCommand.run() that logs all exceptions to SMlog. Traceback
is not truncated. NOTE: All individual lines are limited to 989
characters.

Signed-off-by: Kostas Ladopoulos <Konstantinos.Ladopoulos@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@citrix.com>
CA-129230: [UnitTest] Three Unit Tests regarding the fix

Signed-off-by: Kostas Ladopoulos <Konstantinos.Ladopoulos@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@citrix.com>
Merge branch 'CA-129230' into xs64bit

Signed-off-by: Kostas Ladopoulos <Konstantinos.Ladopoulos@citrix.com>

GitHub: closes #227 on xapi-project/sm