Can enable autostart of VMs

This commit is contained in:
2023-10-28 17:30:27 +02:00
parent 9a15fb4f60
commit 335aec788e
10 changed files with 304 additions and 56 deletions

View File

@ -79,4 +79,19 @@ impl LibVirtClient {
pub async fn screenshot_domain(&self, id: DomainXMLUuid) -> anyhow::Result<Vec<u8>> {
self.0.send(libvirt_actor::ScreenshotDomainReq(id)).await?
}
/// Get auto-start status of a domain
pub async fn is_domain_autostart(&self, id: DomainXMLUuid) -> anyhow::Result<bool> {
self.0.send(libvirt_actor::IsDomainAutostart(id)).await?
}
pub async fn set_domain_autostart(
&self,
id: DomainXMLUuid,
autostart: bool,
) -> anyhow::Result<()> {
self.0
.send(libvirt_actor::SetDomainAutostart(id, autostart))
.await?
}
}