devices/virtio/vhost_user_backend/
mod.rs1mod block;
6mod connection;
7#[cfg(feature = "gpu")]
8pub mod gpu;
9mod handler;
10#[cfg(feature = "net")]
11mod net;
12pub mod params;
13#[cfg(feature = "audio")]
14pub mod snd;
15
16pub use block::run_block_device;
17pub use block::Options as BlockOptions;
18pub use connection::sys::VhostUserListener;
19pub use connection::sys::VhostUserStream;
20pub use connection::VhostUserConnectionTrait;
21use cros_async::Executor;
22#[cfg(feature = "gpu")]
23pub use gpu::run_gpu_device;
24#[cfg(feature = "gpu")]
25pub use gpu::Options as GpuOptions;
26pub use handler::VhostUserDevice;
27#[cfg(feature = "net")]
28pub use net::run_net_device;
29#[cfg(feature = "net")]
30pub use net::NetBackend;
31#[cfg(feature = "net")]
32pub use net::Options as NetOptions;
33#[cfg(feature = "audio")]
34pub use snd::run_snd_device;
35#[cfg(feature = "audio")]
36pub use snd::Options as SndOptions;
37
38pub use crate::virtio::vhost_user_backend::connection::BackendConnection;
39
40cfg_if::cfg_if! {
41 if #[cfg(any(target_os = "android", target_os = "linux"))] {
42 mod console;
43 mod fs;
44 mod vsock;
45 mod wl;
46
47 pub use vsock::{run_vsock_device, Options as VsockOptions, VhostUserVsockDevice};
48 pub use wl::{run_wl_device, parse_wayland_sock, Options as WlOptions};
49 pub use console::{create_vu_console_device, run_console_device, Options as ConsoleOptions};
50 pub use fs::{run_fs_device, Options as FsOptions};
51 } else if #[cfg(windows)] {
52 #[cfg(all(feature = "net", feature = "slirp"))]
53 pub use net::sys::windows::NetBackendConfig;
54 }
55}
56
57pub trait VhostUserDeviceBuilder {
70 fn build(self: Box<Self>, ex: &Executor) -> anyhow::Result<Box<dyn vmm_vhost::Backend>>;
74}