virtio: Enable build and tests for some virtio mods

Still need to enable:
 * balloon (try_clone not implemented)
 * console (Need to enable Serial)
 * snd (Unix code not conditionally compiled out)
 * gpu (Waiting for graphics team to upstream)
 * vhost-user block and handler

The vhost mod is also being built now, but the vhost devices that don't
build on Windows have been disabled.

BUG=b:237011316
TEST=ran "./tools/run_tests --target=host --arch=win64 --verbose"

Change-Id: I3d06a9d49b4bdae14dea47fcfa030834b55925ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3723797
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
This commit is contained in:
Richard 2022-06-24 14:26:02 -07:00 committed by Chromeos LUCI
parent 4f902ffc9e
commit efde16f4d2
2 changed files with 30 additions and 26 deletions

View file

@ -4,67 +4,73 @@
//! Implements virtio devices, queues, and transport mechanisms.
mod async_device;
mod async_utils;
mod descriptor_utils;
mod input;
mod interrupt;
mod iommu;
mod queue;
mod rng;
#[cfg(feature = "tpm")]
mod tpm;
#[cfg(any(feature = "video-decoder", feature = "video-encoder"))]
mod video;
mod virtio_device;
mod virtio_pci_common_config;
mod virtio_pci_device;
pub mod block;
pub mod resource_bridge;
pub mod vhost;
pub use self::block::*;
pub use self::descriptor_utils::Error as DescriptorError;
pub use self::descriptor_utils::*;
pub use self::input::*;
pub use self::interrupt::*;
pub use self::iommu::*;
pub use self::queue::*;
pub use self::rng::*;
#[cfg(feature = "tpm")]
pub use self::tpm::*;
#[cfg(any(feature = "video-decoder", feature = "video-encoder"))]
pub use self::video::*;
pub use self::virtio_device::*;
pub use self::virtio_pci_device::*;
cfg_if::cfg_if! {
if #[cfg(unix)] {
mod async_device;
mod balloon;
mod input;
mod p9;
mod pmem;
mod rng;
#[cfg(feature = "tpm")]
mod tpm;
#[cfg(any(feature = "video-decoder", feature = "video-encoder"))]
mod video;
mod virtio_pci_common_config;
mod virtio_pci_device;
pub mod wl;
pub mod block;
pub mod console;
pub mod fs;
#[cfg(feature = "gpu")]
pub mod gpu;
pub mod net;
pub mod resource_bridge;
#[cfg(feature = "audio")]
pub mod snd;
pub mod vhost;
pub use self::balloon::*;
pub use self::block::*;
pub use self::console::*;
#[cfg(feature = "gpu")]
pub use self::gpu::*;
pub use self::input::*;
#[cfg(unix)]
pub use self::iommu::sys::unix::vfio_wrapper;
pub use self::net::*;
pub use self::p9::*;
pub use self::pmem::*;
pub use self::rng::*;
#[cfg(feature = "audio")]
pub use self::snd::*;
#[cfg(feature = "tpm")]
pub use self::tpm::*;
#[cfg(any(feature = "video-decoder", feature = "video-encoder"))]
pub use self::video::*;
pub use self::virtio_pci_device::*;
pub use self::wl::*;
} else if #[cfg(windows)] {
#[cfg(feature = "slirp")]
pub mod net;
#[cfg(feature = "slirp")]
pub use self::net::*;
} else {
compile_error!("Unsupported platform");
}

View file

@ -2,24 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
mod block;
mod handler;
pub use block::{run_block_device, Options as BlockOptions};
cfg_if::cfg_if! {
if #[cfg(unix)] {
mod block;
#[cfg(feature = "gpu")]
mod gpu;
mod console;
#[cfg(feature = "audio_cras")]
mod cras_snd;
mod fs;
mod handler;
mod net;
mod vsock;
mod vvu;
mod wl;
pub use block::{run_block_device, Options as BlockOptions};
pub use vsock::{run_vsock_device, Options as VsockOptions};
pub use wl::{run_wl_device, parse_wayland_sock, Options as WlOptions};
pub use console::{run_console_device, Options as ConsoleOptions};