diff options
author | Zach Reizner <zachr@google.com> | 2019-06-19 17:46:03 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-08 03:19:58 +0000 |
commit | 0f2cfb095dc2d49bfe22cb2d560b7777a19901e8 (patch) | |
tree | 366bf094ea0194b21f5d7415259281717cb32d3d /src/main.rs | |
parent | 7f855be1f96905c44599b944a0d8449ae528ac39 (diff) | |
download | crosvm-0f2cfb095dc2d49bfe22cb2d560b7777a19901e8.tar crosvm-0f2cfb095dc2d49bfe22cb2d560b7777a19901e8.tar.gz crosvm-0f2cfb095dc2d49bfe22cb2d560b7777a19901e8.tar.bz2 crosvm-0f2cfb095dc2d49bfe22cb2d560b7777a19901e8.tar.lz crosvm-0f2cfb095dc2d49bfe22cb2d560b7777a19901e8.tar.xz crosvm-0f2cfb095dc2d49bfe22cb2d560b7777a19901e8.tar.zst crosvm-0f2cfb095dc2d49bfe22cb2d560b7777a19901e8.zip |
crosvm: add x-display argument for choosing the X11 gpu display
TEST=cargo run -- run --gpu --x-display :0 BUG=None Change-Id: I76b4b33a6b14cb6fad322ffa95f00cce976f81a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1670550 Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 1d18c3b..75d08ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -406,6 +406,14 @@ fn set_argument(cfg: &mut Config, name: &str, value: Option<&str>) -> argument:: } #[cfg(feature = "wl-dmabuf")] "wayland-dmabuf" => cfg.wayland_dmabuf = true, + "x-display" => { + if cfg.x_display.is_some() { + return Err(argument::Error::TooManyArguments( + "`x-display` already given".to_owned(), + )); + } + cfg.x_display = Some(value.unwrap().to_owned()); + } "socket" => { if cfg.socket_path.is_some() { return Err(argument::Error::TooManyArguments( @@ -728,6 +736,7 @@ fn run_vm(args: std::env::Args) -> std::result::Result<(), ()> { stdin - Direct standard input to this serial device. Can only be given once. Will default to first serial port if not provided. "), Argument::value("syslog-tag", "TAG", "When logging to syslog, use the provided tag."), + Argument::value("x-display", "DISPLAY", "X11 display name to use."), Argument::value("wayland-sock", "PATH", "Path to the Wayland socket to use."), #[cfg(feature = "wl-dmabuf")] Argument::flag("wayland-dmabuf", "Enable support for DMABufs in Wayland device."), |