Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
google
GitHub Repository: google/crosvm
Path: blob/main/devices/src/virtio/vhost_user_frontend/sys/windows.rs
5394 views
1
// Copyright 2022 The ChromiumOS Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
use base::SafeDescriptor;
6
use base::Tube;
7
8
use crate::virtio::vhost_user_frontend::handler::BackendReqHandler;
9
use crate::virtio::vhost_user_frontend::handler::BackendReqHandlerImpl;
10
use crate::virtio::vhost_user_frontend::Error;
11
use crate::virtio::vhost_user_frontend::Result as VhostResult;
12
13
pub fn create_backend_req_handler(
14
h: BackendReqHandlerImpl,
15
backend_pid: Option<u32>,
16
) -> VhostResult<(BackendReqHandler, SafeDescriptor)> {
17
let backend_pid = backend_pid.expect("tube needs target pid for backend requests");
18
vmm_vhost::FrontendServer::with_tube(h, backend_pid).map_err(Error::CreateBackendReqHandler)
19
}
20
21