def _disk_profile(profile, hypervisor, **kwargs):
 default = [{'system': {'size': '8192'}}]
 if (hypervisor in ['esxi', 'vmware']):
  overlay = {'format': 'vmdk', 'model': 'scsi', 'pool': '[{0}] '.format(kwargs.get('pool', '0'))}
 elif (hypervisor in ['qemu', 'kvm']):
  overlay = {'format': 'qcow2', 'model': 'virtio', 'pool': __salt__['config.option']('virt.images')}
 else:
  overlay = {}
 disklist = __salt__['config.get']('virt:disk', {}).get(profile, default)
 for (key, val) in six.iteritems(overlay):
  for (i, disks) in enumerate(disklist):
   for disk in disks:
    if (key not in disks[disk]):
     disklist[i][disk][key] = val
 return disklist

def _disk_profile ( profile , hypervisor , ** kwargs ) : default = [ { 'system' : { 'size' : '8192' } } ] if ( hypervisor in [ 'esxi' , 'vmware' ] ) : overlay = { 'format' : 'vmdk' , 'model' : 'scsi' , 'pool' : '[{0}] ' . format ( kwargs . get ( 'pool' , '0' ) ) } elif ( hypervisor in [ 'qemu' , 'kvm' ] ) : overlay = { 'format' : 'qcow2' , 'model' : 'virtio' , 'pool' : __salt__ [ 'config.option' ] ( 'virt.images' ) } else : overlay = { } disklist = __salt__ [ 'config.get' ] ( 'virt:disk' , { } ) . get ( profile , default ) for ( key , val ) in six . iteritems ( overlay ) : for ( i , disks ) in enumerate ( disklist ) : for disk in disks : if ( key not in disks [ disk ] ) : disklist [ i ] [ disk ] [ key ] = val return disklist
gather the disk profile from the config or apply the default based on the active hypervisor this is the default profile for kvm/qemu .