Skip to content

Commit 71608f1

Browse files
authored
ovmm_entry: Fix compiling with no-default-features (#2574)
This lets the whole codebase be cargo-hack clean on linux (with excluding encryption_win).
1 parent 20713dd commit 71608f1

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

openvmm/openvmm_entry/src/lib.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ use mesh::rpc::RpcError;
100100
use mesh::rpc::RpcSend;
101101
use mesh_worker::WorkerEvent;
102102
use mesh_worker::WorkerHandle;
103-
use mesh_worker::launch_local_worker;
104103
use meshworker::VmmMesh;
105104
use net_backend_resources::mac_address::MacAddress;
106105
use pal_async::DefaultDriver;
@@ -137,7 +136,6 @@ use storvsp_resources::ScsiPath;
137136
use tpm_resources::TpmDeviceHandle;
138137
use tpm_resources::TpmRegisterLayout;
139138
use tracing_helpers::AnyhowValueExt;
140-
use ttrpc::TtrpcWorker;
141139
use uidevices_resources::SynthKeyboardHandle;
142140
use uidevices_resources::SynthMouseHandle;
143141
use uidevices_resources::SynthVideoHandle;
@@ -1789,8 +1787,9 @@ fn do_main() -> anyhow::Result<()> {
17891787
return console_relay::relay_console(&path, console_title.as_str());
17901788
}
17911789

1790+
#[cfg(any(feature = "grpc", feature = "ttrpc"))]
17921791
if let Some(path) = opt.ttrpc.as_ref().or(opt.grpc.as_ref()) {
1793-
block_on(async {
1792+
return block_on(async {
17941793
let _ = std::fs::remove_file(path);
17951794
let listener =
17961795
unix_socket::UnixListener::bind(path).context("failed to bind to socket")?;
@@ -1802,11 +1801,12 @@ fn do_main() -> anyhow::Result<()> {
18021801
};
18031802

18041803
// This is a local launch
1805-
let mut handle = launch_local_worker::<TtrpcWorker>(ttrpc::Parameters {
1806-
listener,
1807-
transport,
1808-
})
1809-
.await?;
1804+
let mut handle =
1805+
mesh_worker::launch_local_worker::<ttrpc::TtrpcWorker>(ttrpc::Parameters {
1806+
listener,
1807+
transport,
1808+
})
1809+
.await?;
18101810

18111811
tracing::info!(%transport, path = %path.display(), "listening");
18121812

@@ -1816,15 +1816,15 @@ fn do_main() -> anyhow::Result<()> {
18161816
handle.join().await?;
18171817

18181818
Ok(())
1819-
})
1820-
} else {
1821-
DefaultPool::run_with(async |driver| {
1822-
let mesh = VmmMesh::new(&driver, opt.single_process)?;
1823-
let result = run_control(&driver, &mesh, opt).await;
1824-
mesh.shutdown().await;
1825-
result
1826-
})
1819+
});
18271820
}
1821+
1822+
DefaultPool::run_with(async |driver| {
1823+
let mesh = VmmMesh::new(&driver, opt.single_process)?;
1824+
let result = run_control(&driver, &mesh, opt).await;
1825+
mesh.shutdown().await;
1826+
result
1827+
})
18281828
}
18291829

18301830
fn maybe_with_radix_u64(s: &str) -> Result<u64, String> {

openvmm/openvmm_entry/src/ttrpc/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
//! Worker for the prototype gRPC/ttrpc management endpoint.
55
6+
#![cfg(any(feature = "ttrpc", feature = "grpc"))]
7+
68
use self::vmservice::nic_config::Backend;
79
use crate::serial_io::bind_serial;
810
use anyhow::Context;

0 commit comments

Comments
 (0)