':param context: security context
:param instance:
nova.db.sqlalchemy.models.Instance object
instance object that is migrated.
:param instance_dir:
instance path to use, calculated externally to handle block
migrating an instance with an old style instance path
:param disk_info:
disk info specified in _get_instance_disk_info_from_config
(list of dicts)
:param fallback_from_host:
host where we can retrieve images if the glance images are
not available.'

def _create_images_and_backing(self, context, instance, instance_dir, disk_info, fallback_from_host=None):

    if ((CONF.libvirt.virt_type == 'parallels') and (instance.vm_mode == fields.VMMode.EXE)):
        return
    if (not disk_info):
        disk_info = []
    for info in disk_info:
        base = os.path.basename(info['path'])
        instance_disk = os.path.join(instance_dir, base)
        if ((not info['backing_file']) and (not os.path.exists(instance_disk))):
            libvirt_utils.create_image(info['type'], instance_disk, info['virt_disk_size'])
        elif info['backing_file']:
            cache_name = os.path.basename(info['backing_file'])
            disk = self.image_backend.by_name(instance, instance_disk, CONF.libvirt.images_type)
            if cache_name.startswith('ephemeral'):
                disk.cache(fetch_func=self._create_ephemeral, fs_label=cache_name, os_type=instance.os_type, filename=cache_name, size=info['virt_disk_size'], ephemeral_size=(info['virt_disk_size'] / units.Gi))
            elif cache_name.startswith('swap'):
                inst_type = instance.get_flavor()
                swap_mb = inst_type.swap
                disk.cache(fetch_func=self._create_swap, filename=('swap_%s' % swap_mb), size=(swap_mb * units.Mi), swap_mb=swap_mb)
            else:
                self._try_fetch_image_cache(disk, libvirt_utils.fetch_image, context, cache_name, instance.image_ref, instance, info['virt_disk_size'], fallback_from_host)
    self._fetch_instance_kernel_ramdisk(context, instance, fallback_from_host=fallback_from_host)
