From deed1b927dd8a07be175a68d0879ff6ebc8f51b0 Mon Sep 17 00:00:00 2001 From: Chao Wu Date: Thu, 18 May 2023 15:48:59 +0800 Subject: [PATCH] Dragonball: optimize the placement of dbs-upcall features Currently, the dbs-upcall features have 2 problems that are needed to be fixed : There are redundant dbs-upcall features that are needed to be removed. Some place should be controlled by dbs-upcall but not being implemented. This commit will fix those two problems. fixes: #6878 Signed-off-by: Chao Wu --- src/dragonball/src/api/v1/vmm_action.rs | 1 + src/dragonball/src/vm/mod.rs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dragonball/src/api/v1/vmm_action.rs b/src/dragonball/src/api/v1/vmm_action.rs index 95525c4e68..f8914f10d9 100644 --- a/src/dragonball/src/api/v1/vmm_action.rs +++ b/src/dragonball/src/api/v1/vmm_action.rs @@ -692,6 +692,7 @@ impl VmmService { )); } + #[cfg(feature = "dbs-upcall")] vm.resize_vcpu(config, None).map_err(|e| { if let VcpuResizeError::UpcallServerNotReady = e { return VmmActionError::UpcallServerNotReady; diff --git a/src/dragonball/src/vm/mod.rs b/src/dragonball/src/vm/mod.rs index f1c9700b9c..2964936b7f 100644 --- a/src/dragonball/src/vm/mod.rs +++ b/src/dragonball/src/vm/mod.rs @@ -763,7 +763,6 @@ impl Vm { impl Vm { #[cfg(feature = "dbs-upcall")] /// initialize upcall client for guest os - #[cfg(feature = "dbs-upcall")] fn new_upcall(&mut self) -> std::result::Result<(), StartMicroVmError> { // get vsock inner connector for upcall let inner_connector = self @@ -805,7 +804,6 @@ impl Vm { #[cfg(feature = "dbs-upcall")] /// Get upcall client. - #[cfg(feature = "dbs-upcall")] pub fn upcall_client(&self) -> &Option>> { &self.upcall_client } @@ -825,7 +823,7 @@ impl Vm { } /// Resize MicroVM vCPU number - #[cfg(feature = "hotplug")] + #[cfg(feature = "dbs-upcall")] pub fn resize_vcpu( &mut self, config: VcpuResizeInfo,