CP-5817: Productise removal of lvm2-environment-device.patch

Part of the change for rolling back lvm2-environment-device.patch.
Removed code that exports special environment variable to direct LVM
to look for an abbreviated device cache.

The second part of the change (actual removal of lvm patch) is under
guest-packages.

Signed-off-by: Chandrikas Srinivasan <chandrika.srinivasan@citrix.com>
Reviewed-by: Zheng Li <zheng.li@eu.citrix.com>

GitHub: closes #28 on xapi-project/sm
CP-5831: Productise removal of lvm2-lvchange-idempotent.patch

Part of changes required to remove lvm2-lvchange-idempotent.patch.
LVM throws an error if an LV that is already RO is set to RO again
or an RW lv is set to RW. Added additional check on XS side to check
LV status before changing access permissions.

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

GitHub: closes #26 on xapi-project/sm
CA-118781: revert init order changes

Unfortunately we have to revert the previous 7018eaa and 7ac48731 on
the stricter initialization order.

This is due to some spaghetti calling pattern in our code. In VDI class
and its children, we have the following calling stack:

   Child.__init__ -> Parent.__init__ -> Child.load

When Child.load is called, it assumes that some attributes have already
been initialized, but at this point neither Child.__init__ nor
Parent.__init__ has completed their execution. This code pattern
forces us to initialize those particular attributes in the Child class's
__init___ method before ever calling  Parent.__init__.

This is not pretty, but changing this pattern demands many other changes.
To unblock trunk integration, here we reverted the previous changes.

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
CA-118781: Avoid the dangling "path" attribute of class VDI

The self.path attribute is referenced in VDI class's attach
method but it was not defined/initialized anywhere in class.
The correctness then depends on the children classes always do
the right thing (i.e. do not forget to init the path attribute
if they will ever call parent class's attach method directly
or indirectly).

This is considered as a ERRROR level issue by pylint. As a
fix, here we conditionally set self.path in the __init__
method based on whether a uuid argument is passed to the
initializer or not. For VDI classes whose physical
paths/locations have no direct connection with their UUID
string values (e.g. ISOSR, udevSR and SHMSR), they will not
pass any uuid to the parent class's initialiser and will be
responsible for setup the correct self.path/self.location
value by themselves. We want to make sure that their
customized value won't get overwritten here.

Also fixed the indentation suggested by Vinneth.

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>