From 44fd232dbc75cada61be15e612d0eb70f9368006 Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Thu, 23 Jun 2022 10:44:44 +0900 Subject: [PATCH] crosvm: rename DevicesCommand to DeviceCommand This is the structure for the "device" command, and since we are going to introduce a "devices" one we would like to take over the name. BUG=b:218223240 TEST=cargo check Change-Id: I9e3ef1ad3738f7090126bbfc215930e82547ac3b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716016 Tested-by: kokoro Commit-Queue: Alexandre Courbot Reviewed-by: Daniel Verkamp --- src/crosvm/cmdline.rs | 8 ++++---- src/main.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/crosvm/cmdline.rs b/src/crosvm/cmdline.rs index aa95d7832a..443d6a4999 100644 --- a/src/crosvm/cmdline.rs +++ b/src/crosvm/cmdline.rs @@ -66,7 +66,7 @@ pub enum Command { #[cfg(feature = "composite-disk")] CreateComposite(CreateCompositeCommand), CreateQcow2(CreateQcow2Command), - Device(DevicesCommand), + Device(DeviceCommand), Disk(DiskCommand), MakeRT(MakeRTCommand), Resume(ResumeCommand), @@ -301,9 +301,9 @@ pub struct VfioCrosvmCommand { #[derive(FromArgs)] #[argh(subcommand, name = "device")] /// Start a device process -pub struct DevicesCommand { +pub struct DeviceCommand { #[argh(subcommand)] - pub command: DevicesSubcommand, + pub command: DeviceSubcommand, } #[derive(FromArgs)] @@ -315,7 +315,7 @@ pub enum CrossPlatformDevicesCommands { } #[derive(argh_helpers::FlattenSubcommand)] -pub enum DevicesSubcommand { +pub enum DeviceSubcommand { CrossPlatform(CrossPlatformDevicesCommands), Sys(super::sys::cmdline::DevicesSubcommand), } diff --git a/src/main.rs b/src/main.rs index 09a05a3123..922be2b7ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -333,13 +333,13 @@ fn create_qcow2(cmd: cmdline::CreateQcow2Command) -> std::result::Result<(), ()> Ok(()) } -fn start_device(opts: cmdline::DevicesCommand) -> std::result::Result<(), ()> { +fn start_device(opts: cmdline::DeviceCommand) -> std::result::Result<(), ()> { let result = match opts.command { - cmdline::DevicesSubcommand::CrossPlatform(command) => match command { + cmdline::DeviceSubcommand::CrossPlatform(command) => match command { cmdline::CrossPlatformDevicesCommands::Block(cfg) => run_block_device(cfg), cmdline::CrossPlatformDevicesCommands::Net(cfg) => run_net_device(cfg), }, - cmdline::DevicesSubcommand::Sys(command) => sys::start_device(command), + cmdline::DeviceSubcommand::Sys(command) => sys::start_device(command), }; result.map_err(|e| {