def METHOD_NAME(uvm_plain, snapshot, uffd_handler_paths):
    """
    Test valid uffd handler scenario.
    """
    vm = uvm_plain
    vm.memory_monitor = None
    vm.spawn()
    # Spawn page fault handler process.
    _pf_handler = spawn_pf_handler(
        vm, uffd_handler_paths["valid_handler"], snapshot.mem
    )
    vm.restore_from_snapshot(snapshot, resume=True, uffd_path=SOCKET_PATH)
    # Inflate balloon.
    vm.api.balloon.patch(amount_mib=200)
    # Deflate balloon.
    vm.api.balloon.patch(amount_mib=0)
    # Verify if guest can run commands.
    exit_code, _, _ = vm.ssh.run("sync")
    assert exit_code == 0