def METHOD_NAME(save_format, test, params, env):
    """
    Run virsh save with given format
    :param save_format: format to save with
    :param test: test instance
    :param params: test params
    :param env: test env
    :return: dict-type data of duration and image size
    """
    vm_name = params.get('main_vm')
    vm = env.get_vm(vm_name)
    log_file = params.get('libvirtd_debug_file')
    rand_id = '_' + utils_misc.generate_random_string(3)
    save_path = f'/root/{vm_name}_{save_format}_{rand_id}.save'
    qemu_conf = utils_config.LibvirtQemuConfig()
    libvirtd = utils_libvirtd.Libvirtd()
    qemu_conf.save_image_format = save_format
    libvirtd.restart()
    try:
        pid_ping, upsince = save_base.pre_save_setup(vm)
        save_result = virsh.save(vm_name, save_path, debug=True)
        duration = save_result.duration
        LOG.debug(f'Duration of {format}: {duration}')
        img_size = int(utils_misc.get_image_info(save_path)['dsize'])
        LOG.debug(f'Image size of {format}: {img_size}')
        if save_format != 'raw':
            log_pattern = f'virCommandRunAsync.*{save_format} -c'
            libvirt.check_logfile(log_pattern, log_file)
        virsh.restore(save_path, **VIRSH_ARGS)
        if save_format != 'raw':
            log_pattern = f'virCommandRunAsync.*{save_format} -dc'
            libvirt.check_logfile(log_pattern, log_file)
        save_base.post_save_check(vm, pid_ping, upsince)
        return {'duration': duration, 'img_size': img_size}
    finally:
        if os.path.exists(save_path):
            os.remove(save_path)
        qemu_conf.restore()
        libvirtd.restart()