@bvitnik Hello,
sm-config:vdi_type is the pre-existing one so we are still writing it for compatibility reasons.
But you might notice that vdi_type is only written for LVM-based SRs.
While image-format is always written in XCP-ng with the QCOW2 feature.
So it might be safe to just look at image-format if it exist and if it's not, it's likely a VHD.
On LVMSR, you can fallback on vdi_type (and it should work for XS too).
Indeed, ISO SRs do not advertise a VDI format. Technically, ISOs could be considered to be raw.
It should also be noted that our implementation of QCOW2 is very different from GFS2 QCOW2 of XenServer.
Our implementation uses the existing SR types to allow VHD and QCOW2 to co-exist.