Can start a domain

This commit is contained in:
2023-10-10 12:35:43 +02:00
parent 908b0f4c56
commit 0c7128e6eb
6 changed files with 38 additions and 1 deletions

View File

@ -135,3 +135,18 @@ impl Handler<GetDomainStateReq> for LibVirtActor {
})
}
}
#[derive(Message)]
#[rtype(result = "anyhow::Result<()>")]
pub struct StartDomainReq(pub DomainXMLUuid);
impl Handler<StartDomainReq> for LibVirtActor {
type Result = anyhow::Result<()>;
fn handle(&mut self, msg: StartDomainReq, _ctx: &mut Self::Context) -> Self::Result {
log::debug!("Start domain:\n{}", msg.0.as_string());
let domain = Domain::lookup_by_uuid_string(&self.m, &msg.0.as_string())?;
domain.create()?;
Ok(())
}
}