crosvm: Better error message

Prints only compiled-in options

BUG=b:227659915
TEST=presubmit

Change-Id: If58013fc0d0387237da0c4ab0677efcd317a6fed
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3649737
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Vikram Auradkar 2022-05-11 13:59:27 -07:00 committed by Chromeos LUCI
parent 9c2fe689b7
commit ec482840b9

View file

@ -289,7 +289,10 @@ fn parse_gpu_options(s: Option<&str>, gpu_params: &mut GpuParameters) -> argumen
return Err(argument::Error::InvalidValue {
value: v.to_string(),
expected: String::from(
#[cfg(feature = "gfxstream")]
"gpu parameter 'backend' should be one of (2d|virglrenderer|gfxstream)",
#[cfg(not(feature = "gfxstream"))]
"gpu parameter 'backend' should be one of (2d|3d)",
),
});
}