Fix precommit and precheck.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
CA-118762: Bring self.ty back

My previous pylint change 96e56bf7 replaced self.ty as it was not defined
anywhere in the VDI object. But this breaks some horrible hack in the
underlying layer, which was probably implementated that way for backward
"compatability" reason by itself.

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
(cherry picked from commit c20e26949e7c33a971dea7a3c9fac85348fb1756)
CA-118781: Initialize parent class first

Another incompatability issue introduced by my pylint serie. On the
other hand, the root cause was some bad code manifested due by this
change.

In some subclass of VDI.VDI, we set some fields before initializting
the VDI.VDI parent class, so that these fields might be overwritten
during the parent class initialization.

As a common rule of thumb, we should generally do parent class
initialization first and then do overwritten and extention in
the following steps in the children initializor.

And any information essential for parent class initialization should
be defined as a parameter of the parent __init__ method. E.g. uuid
is a predefined parameter of the initialization method in the parent
class (VDI.VDI), but many children classes still don't use this
parameter, and instead do uuid assignment in the children classes
instead and then call the parent initializor. This patchset doesn't
correct these issues for the moment, but we should pay attention to
this, otherwise we might get bitten in the future.

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
(cherry picked from commit 3060e912c0c1cb9aa1f751cbc2374f8eca2a921e)
CA-125137: sr_ref doesn't always exist

E.g. when doing SR.probe, sr_ref doesn't exist.

Signed-off-by: Zheng Li <zheng.li@citrix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@citrix.com>