def _image_type(vda):
 out = __salt__['cmd.run']('qemu-img info {0}'.format(vda))
 if ('file format: qcow2' in out):
  return 'qcow2'
 else:
  return 'raw'

def _image_type ( vda ) : out = __salt__ [ 'cmd.run' ] ( 'qemu-img info {0}' . format ( vda ) ) if ( 'file format: qcow2' in out ) : return 'qcow2' else : return 'raw'
detect what driver needs to be used for the given image .