CP-8657: Fix XE_SR_ERRORCODES.xml

Signed-off-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #184 xapi-project/sm
CA-134784: [UnitTest] Mimic rmdir, open('w')

Mimic the behavior of rmdir, and also raise the appropriate exceptions
if client wants to open a file in a non-existing directory. Enable the
client to open files with 'w' flag.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-134784: [UnitTest] cover refcounter

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CA-134784: Fix race conditions in refcounter

Concurrent refcounter operations on two different refcounters sharing
the same namespace can lead to race conditions:
 A.) By the time the refcounter file is written, the namespace directory
     has already been removed
 B.) Removing a namespace directory fails, because a a new refcounter file
     has been created within the same directory

_writeCount now returns False if the file was not found

A is solved by spinning on _writeCount until it succeeds.
B is solved by ignoring the errors

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@cirix.com>
CA-134784: [UnitTest] Tests for refcounter

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

GitHub: closes #174 on xapi-project/sm
CA-135017: notify toolstack about tapdisk unpause errors in coalesce

Coalesce is an asynchronous operation so if a tapdisk refresh fails the
VM will lose the disk but the administrator will realise that when the
VM hangs. This patch notifies the toolstack as soon as the failure
occurs.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Acked-by: Germano Percossi <germano.percossi@citrix.com>

GitHub: closes #147 on xapi-project/sm
CP-5962: Revert the commit with the temporary fix for [CA-95530]

There is a problem when raw LUNs containing LVM partitions
created by the guest with a much more recent version of LVM
than the one on Dom0 are scanned by XenServer.
When this problem happens, LVM tools get stuck scanning
consuming 100% of the CPU.

This bug has not been observed any more, so removing the temporary
hack introduced in sm.hg(c099f4902946) in clearwater.

Regardless of the bug, this workaround cannot be in place if
the rawhba SR (aka Borehamwood) is installed by default.

Signed-off-by: Germano Percossi <germano.percossi@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
CP-5962: Borehamwood code into main ISO and not into Supp pack

Signed-off-by: Germano Percossi <germano.percossi@citrix.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Merge CP-5962 into xs64bit

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

GitHub: closes #187 xapi-project/sm
CP-8633: Remove support for MPP RDAC LUNs

This change makes sure that no calls to MPP RDAC drivers (which are not
supported anymore) are made through the storage layer. A check for RDAC LUN
always returns false but not before logging a warning if the RDAC LUN path
is found to be populated.

Signed-off-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>

GitHub: closes #179 xapi-project/sm