Lines Matching refs:map_err
402 let mut j = Minijail::new().map_err(Error::DeviceJail)?; in create_base_minijail()
413 j.uidmap(uid_map).map_err(Error::SettingUidMap)?; in create_base_minijail()
416 j.gidmap(gid_map).map_err(Error::SettingGidMap)?; in create_base_minijail()
437 .map_err(Error::DeviceJail)?; in create_base_minijail()
447 .map_err(Error::DeviceJail)?; in create_base_minijail()
458 j.enter_pivot_root(root).map_err(Error::DevicePivotRoot)?; in create_base_minijail()
464 .map_err(Error::SettingMaxOpenFiles)?; in create_base_minijail()
503 .map_err(|e| Error::Disk(disk.path.to_path_buf(), e))? in create_block_device()
511 flock(&raw_image, lock_op, true).map_err(Error::DiskImageLock)?; in create_block_device()
513 let dev = if disk::async_ok(&raw_image).map_err(Error::CreateDiskError)? { in create_block_device()
514 let async_file = disk::create_async_disk_file(raw_image).map_err(Error::CreateDiskError)?; in create_block_device()
525 .map_err(Error::BlockDeviceNew)?, in create_block_device()
528 let disk_file = disk::create_disk_file(raw_image).map_err(Error::CreateDiskError)?; in create_block_device()
539 .map_err(Error::BlockDeviceNew)?, in create_block_device()
551 .map_err(Error::VhostUserBlockDeviceNew)?; in create_vhost_user_block_device()
566 .map_err(Error::VhostUserFsDeviceNew)?; in create_vhost_user_fs_device()
577 virtio::Rng::new(virtio::base_features(cfg.protected_vm)).map_err(Error::RngDeviceNew)?; in create_rng_device()
612 .map_err(|e| Error::CreateTpmStorage(tpm_storage.to_owned(), e))?; in create_tpm_device()
615 .map_err(Error::ChownTpmStorage)?; in create_tpm_device()
637 .map_err(|e| { in create_single_touch_device()
649 .map_err(Error::InputDeviceNew)?; in create_single_touch_device()
660 .map_err(|e| { in create_multi_touch_device()
672 .map_err(Error::InputDeviceNew)?; in create_multi_touch_device()
681 let socket = trackpad_spec.get_path().into_unix_stream().map_err(|e| { in create_trackpad_device()
693 .map_err(Error::InputDeviceNew)?; in create_trackpad_device()
702 let socket = mouse_socket.into_unix_stream().map_err(|e| { in create_mouse_device()
708 .map_err(Error::InputDeviceNew)?; in create_mouse_device()
717 let socket = keyboard_socket.into_unix_stream().map_err(|e| { in create_keyboard_device()
723 .map_err(Error::InputDeviceNew)?; in create_keyboard_device()
732 let socket = switches_socket.into_unix_stream().map_err(|e| { in create_switches_device()
738 .map_err(Error::InputDeviceNew)?; in create_switches_device()
751 .map_err(|e| Error::OpenVinput(dev_path.to_owned(), e))?; in create_vinput_device()
754 .map_err(Error::InputDeviceNew)?; in create_vinput_device()
764 .map_err(Error::BalloonDeviceNew)?; in create_balloon_device()
776 validate_raw_descriptor(tap_fd).map_err(Error::ValidateRawDescriptor)?, in create_tap_net_device()
778 .map_err(Error::CreateTapDevice)? in create_tap_net_device()
788 let dev = virtio::Net::from(features, tap, vq_pairs).map_err(Error::NetDeviceNew)?; in create_tap_net_device()
820 .map_err(Error::VhostNetDeviceNew)?; in create_net_device()
824 .map_err(Error::NetDeviceNew)?; in create_net_device()
842 .map_err(Error::VhostUserNetDeviceNew)?; in create_vhost_user_net_device()
882 exit_evt.try_clone().map_err(Error::CloneEvent)?, in create_gpu_device()
1032 .map_err(Error::WaylandDeviceNew)?; in create_wayland_device()
1144 .map_err(Error::VhostVsockDeviceNew)?; in create_vhost_vsock_device()
1185 virtio::fs::Fs::new(features, tag, 1, fs_cfg, device_tube).map_err(Error::FsDeviceNew)?; in create_fs_device()
1228 let dev = virtio::P9::new(features, tag, p9_cfg).map_err(Error::P9DeviceNew)?; in create_9p_device()
1253 .map_err(|e| Error::Disk(disk.path.to_path_buf(), e))? in create_pmem_device()
1258 std::fs::metadata(&disk.path).map_err(|e| Error::Disk(disk.path.to_path_buf(), e))?; in create_pmem_device()
1286 let arena_size = usize::try_from(arena_size).map_err(|_| Error::PmemDeviceImageTooBig)?; in create_pmem_device()
1288 let mut arena = MemoryMappingArena::new(arena_size).map_err(Error::ReservePmemMemory)?; in create_pmem_device()
1291 .map_err(Error::ReservePmemMemory)?; in create_pmem_device()
1304 .map_err(Error::AllocatePmemDeviceAddress)?; in create_pmem_device()
1313 .map_err(Error::AddPmemDeviceMemory)?; in create_pmem_device()
1323 .map_err(Error::PmemDeviceNew)?; in create_pmem_device()
1333 let evt = Event::new().map_err(Error::CreateEvent)?; in create_console_device()
1336 .map_err(Error::CreateConsole)?; in create_console_device()
1481 let (wl_socket, gpu_socket) = Tube::pair().map_err(Error::CreateTube)?; in create_virtio_devices()
1496 let (video_tube, gpu_tube) = Tube::pair().map_err(Error::CreateTube)?; in create_virtio_devices()
1505 let (video_tube, gpu_tube) = Tube::pair().map_err(Error::CreateTube)?; in create_virtio_devices()
1518 UnixStream::pair().map_err(Error::CreateSocket)?; in create_virtio_devices()
1530 .map_err(Error::InputDeviceNew)?; in create_virtio_devices()
1539 UnixStream::pair().map_err(Error::CreateSocket)?; in create_virtio_devices()
1544 .map_err(Error::InputDeviceNew)?; in create_virtio_devices()
1656 let (msi_host_tube, msi_device_tube) = Tube::pair().map_err(Error::CreateTube)?; in create_devices()
1659 .map_err(Error::VirtioPciDev)?; in create_devices()
1666 let dev = Ac97Dev::try_new(mem.clone(), ac97_param.clone()).map_err(Error::CreateAc97)?; in create_devices()
1677 VfioContainer::new().map_err(Error::CreateVfioDevice)?, in create_devices()
1683 Tube::pair().map_err(Error::CreateTube)?; in create_devices()
1687 Tube::pair().map_err(Error::CreateTube)?; in create_devices()
1691 Tube::pair().map_err(Error::CreateTube)?; in create_devices()
1695 .map_err(Error::CreateVfioDevice)?; in create_devices()
1747 .map_err(Error::SettingUidMap)?; in add_crosvm_user_to_jail()
1749 .map_err(Error::SettingGidMap)?; in add_crosvm_user_to_jail()
1766 validate_raw_descriptor(raw_descriptor).map_err(Error::ValidateRawDescriptor) in raw_descriptor_from_path()
1779 UnixStream::connect(self).map_err(Error::InputEventsOpen) in into_unix_stream()
1801 .map_err(Error::RegisterSignalHandler)?; in setup_vcpu_signal_handler()
1803 block_signal(SIGRTMIN() + 0).map_err(Error::BlockSignal)?; in setup_vcpu_signal_handler()
1810 .map_err(Error::RegisterSignalHandler)?; in setup_vcpu_signal_handler()
1839 .map_err(Error::CreateVcpu)? in runnable_vcpu()
1850 .map_err(Error::AddIrqChipVcpu)?; in runnable_vcpu()
1868 .map_err(Error::ConfigureVcpu)?; in runnable_vcpu()
1885 let mut v = get_blocked_signals().map_err(Error::GetSignalMask)?; in runnable_vcpu()
1887 vcpu.set_signal_mask(&v).map_err(Error::SettingSignalMask)?; in runnable_vcpu()
1892 .map_err(Error::RunnableVcpu)?; in runnable_vcpu()
1913 Arch::debug_read_registers(vcpu as &V).map_err(Error::HandleDebugCommand)?, in handle_debug_msg()
1918 .map_err(|e| Error::SendDebugStatus(Box::new(e))) in handle_debug_msg()
1921 Arch::debug_write_registers(vcpu as &V, ®s).map_err(Error::HandleDebugCommand)?; in handle_debug_msg()
1927 .map_err(|e| Error::SendDebugStatus(Box::new(e))) in handle_debug_msg()
1939 .map_err(|e| Error::SendDebugStatus(Box::new(e))) in handle_debug_msg()
1943 .map_err(Error::HandleDebugCommand)?; in handle_debug_msg()
1949 .map_err(|e| Error::SendDebugStatus(Box::new(e))) in handle_debug_msg()
1952 Arch::debug_enable_singlestep(vcpu as &V).map_err(Error::HandleDebugCommand)?; in handle_debug_msg()
1958 .map_err(|e| Error::SendDebugStatus(Box::new(e))) in handle_debug_msg()
1962 .map_err(Error::HandleDebugCommand)?; in handle_debug_msg()
1968 .map_err(|e| Error::SendDebugStatus(Box::new(e))) in handle_debug_msg()
2236 .map_err(Error::SpawnVcpu) in run_vcpu()
2248 str::from_utf8(&buf[..count]).map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; in file_fields_to_i64()
2254 .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e)) in file_fields_to_i64()
2292 Arch::guest_memory_layout(&components).map_err(Error::GuestMemoryLayout)?; in run_config()
2299 let kvm = Kvm::new_with_path(&cfg.kvm_device_path).map_err(Error::CreateKvm)?; in run_config()
2300 let vm = KvmVm::new(&kvm, guest_mem).map_err(Error::CreateVm)?; in run_config()
2319 Some(File::open(initrd_path).map_err(|e| Error::OpenInitrd(initrd_path.clone(), e))?) in setup_vm_components()
2326 File::open(kernel_path).map_err(|e| Error::OpenKernel(kernel_path.to_path_buf(), e))?, in setup_vm_components()
2329 File::open(bios_path).map_err(|e| Error::OpenBios(bios_path.to_path_buf(), e))?, in setup_vm_components()
2348 .map(|x| File::open(x).map_err(|e| Error::OpenAndroidFstab(x.to_path_buf(), e))) in setup_vm_components()
2357 .map(|path| SDT::from_file(path).map_err(|e| Error::OpenAcpiTable(path.clone(), e))) in setup_vm_components()
2391 HostBackendDeviceProvider::new().map_err(Error::CreateUsbProvider)?; in run_vm()
2395 let sigchld_fd = SignalFd::new(libc::SIGCHLD).map_err(Error::CreateSignalFd)?; in run_vm()
2399 UnixSeqpacketListener::bind(path).map_err(Error::CreateControlServer)?, in run_vm()
2409 let (gdb_host_tube, gdb_control_tube) = Tube::pair().map_err(Error::CreateTube)?; in run_vm()
2414 let (wayland_host_tube, wayland_device_tube) = Tube::pair().map_err(Error::CreateTube)?; in run_vm()
2417 let (balloon_host_tube, balloon_device_tube) = Tube::pair().map_err(Error::CreateTube)?; in run_vm()
2424 let (disk_host_tub, disk_device_tube) = Tube::pair().map_err(Error::CreateTube)?; in run_vm()
2432 let (pmem_host_tube, pmem_device_tube) = Tube::pair().map_err(Error::CreateTube)?; in run_vm()
2437 let (gpu_host_tube, gpu_device_tube) = Tube::pair().map_err(Error::CreateTube)?; in run_vm()
2440 let (ioapic_host_tube, ioapic_device_tube) = Tube::pair().map_err(Error::CreateTube)?; in run_vm()
2473 let gralloc = RutabagaGralloc::new().map_err(Error::CreateGrallocError)?; in run_vm()
2483 let (fs_host_tube, fs_device_tube) = Tube::pair().map_err(Error::CreateTube)?; in run_vm()
2515 .map_err(Error::BuildVm)?; in run_vm()
2520 Arc::new(devices::DirectIo::new(&pmio.path, false).map_err(Error::DirectIo)?); in run_vm()
2537 let trigger = Event::new().map_err(Error::CreateEvent)?; in run_vm()
2538 let resample = Event::new().map_err(Error::CreateEvent)?; in run_vm()
2544 devices::DirectIrq::new(trigger, Some(resample)).map_err(Error::DirectIrq)?; in run_vm()
2545 direct_irq.irq_enable(*irq).map_err(Error::DirectIrq)?; in run_vm()
2554 let trigger = Event::new().map_err(Error::CreateEvent)?; in run_vm()
2559 let direct_irq = devices::DirectIrq::new(trigger, None).map_err(Error::DirectIrq)?; in run_vm()
2560 direct_irq.irq_enable(*irq).map_err(Error::DirectIrq)?; in run_vm()
2662 .map_err(Error::GuestFreeTooLarge)?; in delta()
2667 .map_err(Error::GuestFreeTooLarge)?; in delta()
2675 file_to_i64(LOWMEM_AVAILABLE, 0).map_err(Error::ReadMemAvailable)? * ONE_MB; in delta()
2795 .map_err(Error::WaitContextAdd)?; in run_control()
2800 .map_err(Error::WaitContextAdd)?; in run_control()
2805 .map_err(Error::WaitContextAdd)?; in run_control()
2811 .map_err(Error::WaitContextAdd)?; in run_control()
2816 .map_err(Error::WaitContextAdd)?; in run_control()
2820 let mut balancemem_timer = Timer::new().map_err(Error::CreateTimer)?; in run_control()
2825 .map_err(Error::WaitContextAdd)?; in run_control()
2830 .map_err(Error::ResetTimer)?; in run_control()
2835 .map_err(Error::WaitContextAdd)?; in run_control()
2848 drop_capabilities().map_err(Error::DropCapabilities)?; in run_control()
2882 linux.vm.try_clone().map_err(Error::CloneEvent)?, in run_control()
2883 linux.irq_chip.try_clone().map_err(Error::CloneEvent)?, in run_control()
2892 linux.exit_evt.try_clone().map_err(Error::CloneEvent)?, in run_control()
2917 .map_err(Error::SpawnGdbServer)?; in run_control()
2951 while let Some(siginfo) = sigchld_fd.read().map_err(Error::SignalFd)? { in run_control()
2970 balancemem_timer.wait().map_err(Error::Timer)?; in run_control()
3024 .map_err(Error::WaitContextAdd)?; in run_control()
3218 wait_ctx.delete(socket).map_err(Error::WaitContextDelete)?; in run_control()
3229 .map_err(Error::WaitContextAdd)?; in run_control()