Can enable autostart of VMs
This commit is contained in:
@ -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?
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user