Can get XML network definition
This commit is contained in:
@ -452,6 +452,20 @@ impl Handler<GetNetworkXMLReq> for LibVirtActor {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Message)]
|
||||
#[rtype(result = "anyhow::Result<String>")]
|
||||
pub struct GetSourceNetworkXMLReq(pub XMLUuid);
|
||||
|
||||
impl Handler<GetSourceNetworkXMLReq> for LibVirtActor {
|
||||
type Result = anyhow::Result<String>;
|
||||
|
||||
fn handle(&mut self, msg: GetSourceNetworkXMLReq, _ctx: &mut Self::Context) -> Self::Result {
|
||||
log::debug!("Get network XML:\n{}", msg.0.as_string());
|
||||
let network = Network::lookup_by_uuid_string(&self.m, &msg.0.as_string())?;
|
||||
Ok(network.get_xml_desc(0)?)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Message)]
|
||||
#[rtype(result = "anyhow::Result<()>")]
|
||||
pub struct DeleteNetwork(pub XMLUuid);
|
||||
|
Reference in New Issue
Block a user