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