Can shutdown, kill, suspend, resume, reset a domain
This commit is contained in:
@ -42,4 +42,29 @@ impl LibVirtClient {
|
||||
pub async fn start_domain(&self, id: DomainXMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::StartDomainReq(id)).await?
|
||||
}
|
||||
|
||||
/// Shutdown a domain
|
||||
pub async fn shutdown_domain(&self, id: DomainXMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::ShutdownDomainReq(id)).await?
|
||||
}
|
||||
|
||||
/// Kill a domain
|
||||
pub async fn kill_domain(&self, id: DomainXMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::KillDomainReq(id)).await?
|
||||
}
|
||||
|
||||
/// Reset a domain
|
||||
pub async fn reset_domain(&self, id: DomainXMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::ResetDomainReq(id)).await?
|
||||
}
|
||||
|
||||
/// Suspend a domain
|
||||
pub async fn suspend_domain(&self, id: DomainXMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::SuspendDomainReq(id)).await?
|
||||
}
|
||||
|
||||
/// Resume a domain
|
||||
pub async fn resume_domain(&self, id: DomainXMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::ResumeDomainReq(id)).await?
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user