vmm_vhost: sys: Align platform-specific code with style guide

Update /third_party/vmm_vhost/stc/sys.rs to align it with the code
organization described in
https://crosvm.dev/book/contributing/style_guide_platform_specific_code.html#code-organization

BUG=none
TEST=cargo check in /devices
TEST=cargo check --target=x86_64-pc-windows-gnu in /devices

Change-Id: I4f4035aadcd800335ceb035ab9645c2e6c6b0732
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3932449
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
This commit is contained in:
Keiichi Watanabe 2022-10-04 22:14:59 +09:00 committed by crosvm LUCI
parent eb1923b6ec
commit 07c9bdf352
3 changed files with 11 additions and 8 deletions

View file

@ -23,9 +23,9 @@ use crate::connection::Listener as ListenerTrait;
use crate::connection::Req; use crate::connection::Req;
use crate::message::*; use crate::message::*;
use crate::take_single_file; use crate::take_single_file;
use crate::unix::SystemListener;
use crate::Error; use crate::Error;
use crate::Result; use crate::Result;
use crate::SystemListener;
use crate::SystemStream; use crate::SystemStream;
/// Unix domain socket listener for accepting incoming connections. /// Unix domain socket listener for accepting incoming connections.

View file

@ -5,12 +5,18 @@
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(unix)] { if #[cfg(unix)] {
mod unix; pub mod unix;
pub use unix::*; use unix as platform;
} else if #[cfg(windows)] { } else if #[cfg(windows)] {
mod windows; pub mod windows;
pub use windows::*; use windows as platform;
} else { } else {
compile_error!("Unsupported platform"); compile_error!("Unsupported platform");
} }
} }
#[cfg(feature = "device")]
pub(crate) use platform::MasterReqEndpoint;
#[cfg(feature = "device")]
pub(crate) use platform::SlaveReqEndpoint;
pub use platform::SystemStream;

View file

@ -17,6 +17,3 @@ cfg_if::cfg_if! {
pub(crate) type MasterReqEndpoint = TubeEndpoint<MasterReq>; pub(crate) type MasterReqEndpoint = TubeEndpoint<MasterReq>;
} }
} }
/// Collection of platform-specific methods that SystemListener provides.
pub(crate) trait SystemListenerExt {}