| 888 | } |
| 889 | |
| 890 | pub async fn vm_info(&self, id: &str) -> Result<Option<pb::VmInfo>> { |
| 891 | let proc_state = self.supervisor.info(id).await?; |
| 892 | let state = self.lock(); |
| 893 | let Some(vm_state) = state.get(id) else { |
| 894 | return Ok(None); |
| 895 | }; |
| 896 | let info = vm_state |
| 897 | .merged_info(proc_state.as_ref(), &self.work_dir(id)) |
| 898 | .to_pb(&self.config.gateway, false); |
| 899 | Ok(Some(info)) |
| 900 | } |
| 901 | |
| 902 | pub(crate) fn vm_event_report(&self, cid: u32, event: &str, body: String) -> Result<()> { |
| 903 | info!(cid, event, "VM event"); |