mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 23:07:55 +00:00
Merge pull request #10683 from justxuewei/nxw/remove-mut
This commit is contained in:
@@ -46,7 +46,7 @@ impl CloudHypervisor {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn set_hypervisor_config(&mut self, config: HypervisorConfig) {
|
||||
pub async fn set_hypervisor_config(&self, config: HypervisorConfig) {
|
||||
let mut inner = self.inner.write().await;
|
||||
inner.set_hypervisor_config(config)
|
||||
}
|
||||
|
@@ -629,7 +629,7 @@ mod tests {
|
||||
.get(hypervisor_name)
|
||||
.ok_or_else(|| anyhow!("failed to get hypervisor for {}", &hypervisor_name))?;
|
||||
|
||||
let mut hypervisor = Qemu::new();
|
||||
let hypervisor = Qemu::new();
|
||||
hypervisor
|
||||
.set_hypervisor_config(hypervisor_config.clone())
|
||||
.await;
|
||||
|
@@ -56,12 +56,12 @@ impl Dragonball {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn set_hypervisor_config(&mut self, config: HypervisorConfig) {
|
||||
pub async fn set_hypervisor_config(&self, config: HypervisorConfig) {
|
||||
let mut inner = self.inner.write().await;
|
||||
inner.set_hypervisor_config(config)
|
||||
}
|
||||
|
||||
pub async fn set_passfd_listener_port(&mut self, port: u32) {
|
||||
pub async fn set_passfd_listener_port(&self, port: u32) {
|
||||
let mut inner = self.inner.write().await;
|
||||
inner.set_passfd_listener_port(port)
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ impl Firecracker {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn set_hypervisor_config(&mut self, config: HypervisorConfig) {
|
||||
pub async fn set_hypervisor_config(&self, config: HypervisorConfig) {
|
||||
let mut inner = self.inner.write().await;
|
||||
inner.set_hypervisor_config(config)
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ impl Qemu {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn set_hypervisor_config(&mut self, config: HypervisorConfig) {
|
||||
pub async fn set_hypervisor_config(&self, config: HypervisorConfig) {
|
||||
let mut inner = self.inner.write().await;
|
||||
inner.set_hypervisor_config(config)
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ impl Remote {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn set_hypervisor_config(&mut self, config: HypervisorConfig) {
|
||||
pub async fn set_hypervisor_config(&self, config: HypervisorConfig) {
|
||||
let mut inner = self.inner.write().await;
|
||||
inner.set_hypervisor_config(config)
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ mod tests {
|
||||
.get(hypervisor_name)
|
||||
.ok_or_else(|| anyhow!("failed to get hypervisor for {}", &hypervisor_name))?;
|
||||
|
||||
let mut hypervisor = Qemu::new();
|
||||
let hypervisor = Qemu::new();
|
||||
hypervisor
|
||||
.set_hypervisor_config(hypervisor_config.clone())
|
||||
.await;
|
||||
|
@@ -158,7 +158,7 @@ async fn new_hypervisor(toml_config: &TomlConfig) -> Result<Arc<dyn Hypervisor>>
|
||||
match hypervisor_name.as_str() {
|
||||
#[cfg(all(feature = "dragonball", not(target_arch = "s390x")))]
|
||||
HYPERVISOR_DRAGONBALL => {
|
||||
let mut hypervisor = Dragonball::new();
|
||||
let hypervisor = Dragonball::new();
|
||||
hypervisor
|
||||
.set_hypervisor_config(hypervisor_config.clone())
|
||||
.await;
|
||||
@@ -170,7 +170,7 @@ async fn new_hypervisor(toml_config: &TomlConfig) -> Result<Arc<dyn Hypervisor>>
|
||||
Ok(Arc::new(hypervisor))
|
||||
}
|
||||
HYPERVISOR_QEMU => {
|
||||
let mut hypervisor = Qemu::new();
|
||||
let hypervisor = Qemu::new();
|
||||
hypervisor
|
||||
.set_hypervisor_config(hypervisor_config.clone())
|
||||
.await;
|
||||
@@ -178,7 +178,7 @@ async fn new_hypervisor(toml_config: &TomlConfig) -> Result<Arc<dyn Hypervisor>>
|
||||
}
|
||||
#[cfg(not(target_arch = "s390x"))]
|
||||
HYPERVISOR_FIRECRACKER => {
|
||||
let mut hypervisor = Firecracker::new();
|
||||
let hypervisor = Firecracker::new();
|
||||
hypervisor
|
||||
.set_hypervisor_config(hypervisor_config.clone())
|
||||
.await;
|
||||
@@ -186,16 +186,14 @@ async fn new_hypervisor(toml_config: &TomlConfig) -> Result<Arc<dyn Hypervisor>>
|
||||
}
|
||||
#[cfg(all(feature = "cloud-hypervisor", not(target_arch = "s390x")))]
|
||||
HYPERVISOR_NAME_CH => {
|
||||
let mut hypervisor = CloudHypervisor::new();
|
||||
|
||||
let hypervisor = CloudHypervisor::new();
|
||||
hypervisor
|
||||
.set_hypervisor_config(hypervisor_config.clone())
|
||||
.await;
|
||||
|
||||
Ok(Arc::new(hypervisor))
|
||||
}
|
||||
HYPERVISOR_REMOTE => {
|
||||
let mut hypervisor = Remote::new();
|
||||
let hypervisor = Remote::new();
|
||||
hypervisor
|
||||
.set_hypervisor_config(hypervisor_config.clone())
|
||||
.await;
|
||||
|
Reference in New Issue
Block a user