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 <chaowu@linux.alibaba.com>
This commit is contained in:
Chao Wu 2023-05-18 15:48:59 +08:00
parent cf258090aa
commit deed1b927d
2 changed files with 2 additions and 3 deletions

View File

@ -692,6 +692,7 @@ impl VmmService {
)); ));
} }
#[cfg(feature = "dbs-upcall")]
vm.resize_vcpu(config, None).map_err(|e| { vm.resize_vcpu(config, None).map_err(|e| {
if let VcpuResizeError::UpcallServerNotReady = e { if let VcpuResizeError::UpcallServerNotReady = e {
return VmmActionError::UpcallServerNotReady; return VmmActionError::UpcallServerNotReady;

View File

@ -763,7 +763,6 @@ impl Vm {
impl Vm { impl Vm {
#[cfg(feature = "dbs-upcall")] #[cfg(feature = "dbs-upcall")]
/// initialize upcall client for guest os /// initialize upcall client for guest os
#[cfg(feature = "dbs-upcall")]
fn new_upcall(&mut self) -> std::result::Result<(), StartMicroVmError> { fn new_upcall(&mut self) -> std::result::Result<(), StartMicroVmError> {
// get vsock inner connector for upcall // get vsock inner connector for upcall
let inner_connector = self let inner_connector = self
@ -805,7 +804,6 @@ impl Vm {
#[cfg(feature = "dbs-upcall")] #[cfg(feature = "dbs-upcall")]
/// Get upcall client. /// Get upcall client.
#[cfg(feature = "dbs-upcall")]
pub fn upcall_client(&self) -> &Option<Arc<UpcallClient<DevMgrService>>> { pub fn upcall_client(&self) -> &Option<Arc<UpcallClient<DevMgrService>>> {
&self.upcall_client &self.upcall_client
} }
@ -825,7 +823,7 @@ impl Vm {
} }
/// Resize MicroVM vCPU number /// Resize MicroVM vCPU number
#[cfg(feature = "hotplug")] #[cfg(feature = "dbs-upcall")]
pub fn resize_vcpu( pub fn resize_vcpu(
&mut self, &mut self,
config: VcpuResizeInfo, config: VcpuResizeInfo,