Path: blob/main/devices/src/virtio/vhost_user_frontend/sys/windows.rs
5394 views
// Copyright 2022 The ChromiumOS Authors1// Use of this source code is governed by a BSD-style license that can be2// found in the LICENSE file.34use base::SafeDescriptor;5use base::Tube;67use crate::virtio::vhost_user_frontend::handler::BackendReqHandler;8use crate::virtio::vhost_user_frontend::handler::BackendReqHandlerImpl;9use crate::virtio::vhost_user_frontend::Error;10use crate::virtio::vhost_user_frontend::Result as VhostResult;1112pub fn create_backend_req_handler(13h: BackendReqHandlerImpl,14backend_pid: Option<u32>,15) -> VhostResult<(BackendReqHandler, SafeDescriptor)> {16let backend_pid = backend_pid.expect("tube needs target pid for backend requests");17vmm_vhost::FrontendServer::with_tube(h, backend_pid).map_err(Error::CreateBackendReqHandler)18}192021