mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 04:07:23 +00:00
devices: vhost-user: wl: add vvu support
Add vvu support to vhost-user-wl. BUG=b:201745804 TEST=launch crostini gui application on ManaTEE Change-Id: I3f8416c2de0419e4ef517866c964fd0c32b3f2a0 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765018 Tested-by: David Stevens <stevensd@chromium.org> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: David Stevens <stevensd@chromium.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
parent
5451eaf8b3
commit
589905763f
1 changed files with 8 additions and 3 deletions
|
@ -312,7 +312,10 @@ pub fn parse_wayland_sock(value: &str) -> Result<(String, PathBuf), String> {
|
|||
pub struct Options {
|
||||
#[argh(option, arg_name = "PATH")]
|
||||
/// path to bind a listening vhost-user socket
|
||||
socket: String,
|
||||
socket: Option<String>,
|
||||
#[argh(option, arg_name = "STRING")]
|
||||
/// VFIO-PCI device name (e.g. '0000:00:07.0')
|
||||
vfio: Option<String>,
|
||||
#[argh(option, from_str_fn(parse_wayland_sock), arg_name = "PATH[,name=NAME]")]
|
||||
/// path to one or more Wayland sockets. The unnamed socket is used for
|
||||
/// displaying virtual screens while the named ones are used for IPC
|
||||
|
@ -328,6 +331,7 @@ pub fn run_wl_device(opts: Options) -> anyhow::Result<()> {
|
|||
let Options {
|
||||
wayland_sock,
|
||||
socket,
|
||||
vfio,
|
||||
resource_bridge,
|
||||
} = opts;
|
||||
|
||||
|
@ -354,9 +358,10 @@ pub fn run_wl_device(opts: Options) -> anyhow::Result<()> {
|
|||
|
||||
let ex = Executor::new().context("failed to create executor")?;
|
||||
|
||||
let backend = Box::new(WlBackend::new(&ex, wayland_paths, resource_bridge));
|
||||
let listener =
|
||||
VhostUserListener::new_from_socket_or_vfio(&socket, &vfio, wl::QUEUE_SIZES.len(), None)?;
|
||||
|
||||
let listener = VhostUserListener::new_socket(&socket, None)?;
|
||||
let backend = Box::new(WlBackend::new(&ex, wayland_paths, resource_bridge));
|
||||
// run_until() returns an Result<Result<..>> which the ? operator lets us flatten.
|
||||
ex.run_until(listener.run_backend(backend, &ex))?
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue