Can view from web UI XML definition of domains

This commit is contained in:
2023-12-08 18:14:01 +01:00
parent 74b77be013
commit 82447a0018
13 changed files with 632 additions and 135 deletions

View File

@ -99,6 +99,20 @@ impl Handler<GetDomainXMLReq> for LibVirtActor {
}
}
#[derive(Message)]
#[rtype(result = "anyhow::Result<String>")]
pub struct GetSourceDomainXMLReq(pub XMLUuid);
impl Handler<GetSourceDomainXMLReq> for LibVirtActor {
type Result = anyhow::Result<String>;
fn handle(&mut self, msg: GetSourceDomainXMLReq, _ctx: &mut Self::Context) -> Self::Result {
log::debug!("Get domain source XML:\n{}", msg.0.as_string());
let domain = Domain::lookup_by_uuid_string(&self.m, &msg.0.as_string())?;
Ok(domain.get_xml_desc(VIR_DOMAIN_XML_SECURE)?)
}
}
#[derive(Message)]
#[rtype(result = "anyhow::Result<XMLUuid>")]
pub struct DefineDomainReq(pub DomainXML);