Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
google
GitHub Repository: google/crosvm
Path: blob/main/devices/src/virtio/vhost_user_frontend/sys/unix.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 vmm_vhost::FrontendServer;
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
) -> VhostResult<(BackendReqHandler, SafeDescriptor)> {
16
FrontendServer::with_stream(h).map_err(Error::CreateBackendReqHandler)
17
}
18
19