MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / vm_create

Method vm_create

vmm/src/api/dbus/mod.rs:213–233  ·  view source on GitHub ↗
(&self, vm_config: String)

Source from the content-addressed store, hash-verified

211 }
212
213 async fn vm_create(&self, vm_config: String) -> Result<()> {
214 let api_sender = self.clone_api_sender().await;
215 let api_notifier = self.clone_api_notifier()?;
216
217 let mut vm_config: Box<VmConfig> = serde_json::from_str(&vm_config).map_err(api_error)?;
218
219 if let Some(ref mut nets) = vm_config.net {
220 if nets.iter().any(|net| net.fds.is_some()) {
221 warn!("Ignoring FDs sent via the D-Bus request body");
222 }
223 for net in nets {
224 net.fds = None;
225 }
226 }
227
228 blocking::unblock(move || VmCreate.send(api_notifier, api_sender, vm_config))
229 .await
230 .map_err(api_error)?;
231
232 Ok(())
233 }
234
235 async fn vm_delete(&self) -> Result<()> {
236 self.vm_action(&VmDelete, ()).await.map(|_| ())

Callers 1

requestMethod · 0.45

Calls 4

clone_api_senderMethod · 0.80
clone_api_notifierMethod · 0.80
iterMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected