Fix mouse cursor shift
This commit is contained in:
parent
cb49f1cb40
commit
78ed6114c8
@ -133,9 +133,15 @@ impl Handler<DefineDomainReq> for LibVirtActor {
|
||||
let start_offset = network_xml.find("<interface").unwrap();
|
||||
devices_xml.push(network_xml[start_offset..].to_string());
|
||||
}
|
||||
for input in msg.0.devices.inputs {
|
||||
let input_xml = serde_xml_rs::to_string(&input)?;
|
||||
let start_offset = input_xml.find("<input").unwrap();
|
||||
devices_xml.push(input_xml[start_offset..].to_string());
|
||||
}
|
||||
|
||||
msg.0.devices.disks = vec![];
|
||||
msg.0.devices.net_interfaces = vec![];
|
||||
msg.0.devices.inputs = vec![];
|
||||
|
||||
let mut xml = serde_xml_rs::to_string(&msg.0)?;
|
||||
let disks_xml = devices_xml.join("\n");
|
||||
|
@ -79,6 +79,13 @@ pub struct DomainNetInterfaceXML {
|
||||
pub source: Option<NetIntSourceXML>,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename = "input")]
|
||||
pub struct DomainInputXML {
|
||||
#[serde(rename(serialize = "@type"))]
|
||||
pub r#type: String,
|
||||
}
|
||||
|
||||
/// Devices information
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename = "devices")]
|
||||
@ -94,6 +101,10 @@ pub struct DevicesXML {
|
||||
/// Networks cards
|
||||
#[serde(default, rename = "interface", skip_serializing_if = "Vec::is_empty")]
|
||||
pub net_interfaces: Vec<DomainNetInterfaceXML>,
|
||||
|
||||
/// Input devices
|
||||
#[serde(default, rename = "input", skip_serializing_if = "Vec::is_empty")]
|
||||
pub inputs: Vec<DomainInputXML>,
|
||||
}
|
||||
|
||||
/// Screen information
|
||||
|
@ -2,10 +2,10 @@ use crate::app_config::AppConfig;
|
||||
use crate::constants;
|
||||
use crate::libvirt_lib_structures::{
|
||||
DevicesXML, DiskBootXML, DiskDriverXML, DiskReadOnlyXML, DiskSourceXML, DiskTargetXML, DiskXML,
|
||||
DomainCPUTopology, DomainCPUXML, DomainMemoryXML, DomainNetInterfaceXML, DomainVCPUXML,
|
||||
DomainXML, FeaturesXML, GraphicsXML, NetIntSourceXML, NetworkDHCPRangeXML, NetworkDHCPXML,
|
||||
NetworkDNSForwarderXML, NetworkDNSXML, NetworkDomainXML, NetworkForwardXML, NetworkIPXML,
|
||||
NetworkXML, OSLoaderXML, OSTypeXML, XMLUuid, ACPIXML, OSXML,
|
||||
DomainCPUTopology, DomainCPUXML, DomainInputXML, DomainMemoryXML, DomainNetInterfaceXML,
|
||||
DomainVCPUXML, DomainXML, FeaturesXML, GraphicsXML, NetIntSourceXML, NetworkDHCPRangeXML,
|
||||
NetworkDHCPXML, NetworkDNSForwarderXML, NetworkDNSXML, NetworkDomainXML, NetworkForwardXML,
|
||||
NetworkIPXML, NetworkXML, OSLoaderXML, OSTypeXML, XMLUuid, ACPIXML, OSXML,
|
||||
};
|
||||
use crate::libvirt_rest_structures::LibVirtStructError::StructureExtraction;
|
||||
use crate::utils::disks_utils::Disk;
|
||||
@ -270,6 +270,17 @@ impl VMInfo {
|
||||
graphics: vnc_graphics,
|
||||
disks,
|
||||
net_interfaces: networks,
|
||||
inputs: vec![
|
||||
DomainInputXML {
|
||||
r#type: "mouse".to_string(),
|
||||
},
|
||||
DomainInputXML {
|
||||
r#type: "keyboard".to_string(),
|
||||
},
|
||||
DomainInputXML {
|
||||
r#type: "tablet".to_string(),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
memory: DomainMemoryXML {
|
||||
|
Loading…
Reference in New Issue
Block a user