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

Method vm_coredump

vmm/src/api/dbus/mod.rs:194–207  ·  view source on GitHub ↗

zbus doesn't support cfg attributes on interface methods as a workaround, we make the *call to the internal API* conditionally compile and return an error on unsupported platforms.

(&self, vm_coredump_data: String)

Source from the content-addressed store, hash-verified

192 // as a workaround, we make the *call to the internal API* conditionally
193 // compile and return an error on unsupported platforms.
194 async fn vm_coredump(&self, vm_coredump_data: String) -> Result<()> {
195 #[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]
196 {
197 let vm_coredump_data = serde_json::from_str(&vm_coredump_data).map_err(api_error)?;
198 self.vm_action(&VmCoredump, vm_coredump_data)
199 .await
200 .map(|_| ())
201 }
202
203 #[cfg(not(all(target_arch = "x86_64", feature = "guest_debug")))]
204 Err(api_error(
205 "VmCoredump only works on x86_64 with the `guest_debug` feature enabled",
206 ))
207 }
208
209 async fn vm_counters(&self) -> Result<Optional<String>> {
210 self.vm_action(&VmCounters, ()).await

Callers 1

requestMethod · 0.45

Calls 3

api_errorFunction · 0.85
vm_actionMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected