From 8bcd18bdebf74ca49c5160275a563f34417daa53 Mon Sep 17 00:00:00 2001 From: Vikram Auradkar Date: Wed, 13 Jul 2022 01:08:31 +0000 Subject: [PATCH] devices: enable debugcon on windows new_with_pipe is not implemented yet. BUG=b:213149155 TEST=presubmit Change-Id: I1062bc964e6204088660fd1a04bbce09a77e293d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3760144 Reviewed-by: Daniel Verkamp Commit-Queue: Vikram Auradkar Auto-Submit: Vikram Auradkar Tested-by: kokoro --- devices/src/debugcon.rs | 13 +++++++++++++ devices/src/lib.rs | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/devices/src/debugcon.rs b/devices/src/debugcon.rs index 330ca37038..d9eb747060 100644 --- a/devices/src/debugcon.rs +++ b/devices/src/debugcon.rs @@ -4,6 +4,8 @@ use std::io::{self, Write}; +#[cfg(windows)] +use base::named_pipes; use base::{error, Event, FileSync, RawDescriptor, Result}; use hypervisor::ProtectionType; @@ -29,6 +31,17 @@ impl SerialDevice for Debugcon { ) -> Debugcon { Debugcon { out } } + + #[cfg(windows)] + fn new_with_pipe( + _protected_vm: ProtectionType, + _interrupt_evt: Event, + _pipe_in: named_pipes::PipeConnection, + _pipe_out: named_pipes::PipeConnection, + _keep_rds: Vec, + ) -> Debugcon { + unimplemented!("new_with_pipe unimplemented for Debugcon"); + } } impl BusDevice for Debugcon { diff --git a/devices/src/lib.rs b/devices/src/lib.rs index 77dd8128de..77bd1b9a0f 100644 --- a/devices/src/lib.rs +++ b/devices/src/lib.rs @@ -8,6 +8,8 @@ mod bus; mod cmos; +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +mod debugcon; #[cfg(feature = "direct")] pub mod direct_io; #[cfg(feature = "direct")] @@ -42,6 +44,8 @@ pub use self::bus::{ HostHotPlugKey, HotPlugBus, }; pub use self::cmos::Cmos; +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +pub use self::debugcon::Debugcon; #[cfg(feature = "direct")] pub use self::direct_io::{DirectIo, DirectMmio}; #[cfg(feature = "direct")] @@ -67,8 +71,6 @@ pub use self::vtpm_proxy::VtpmProxy; cfg_if::cfg_if! { if #[cfg(unix)] { - #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] - mod debugcon; mod platform; mod proxy; pub mod acpi; @@ -82,8 +84,6 @@ cfg_if::cfg_if! { pub use self::acpi::ACPIPMResource; pub use self::bat::{BatteryError, GoldfishBattery}; pub use self::bus::Error as BusError; - #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] - pub use self::debugcon::Debugcon; #[cfg(feature = "audio")] pub use self::pci::{Ac97Backend, Ac97Dev, Ac97Parameters}; pub use self::pci::{ PciBus,