File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,6 @@ pub enum ConfigurationError {
5353 VcpuConfig ( CpuConfigurationError ) ,
5454 /// Error configuring the vcpu: {0}
5555 VcpuConfigure ( KvmVcpuError ) ,
56- /// Error applying vcpu template: {0}
57- VcpuApplyTemplate ( CpuConfigurationError ) ,
5856}
5957
6058/// The start of the memory area reserved for MMIO devices.
@@ -84,8 +82,7 @@ pub fn configure_system_for_boot(
8482 CpuConfiguration :: new ( cpu_template, vcpus) . map_err ( ConfigurationError :: VcpuConfig ) ?;
8583
8684 // Apply CPU template to the base CpuConfiguration.
87- let cpu_config = CpuConfiguration :: apply_template ( cpu_config, cpu_template)
88- . map_err ( ConfigurationError :: VcpuApplyTemplate ) ?;
85+ let cpu_config = CpuConfiguration :: apply_template ( cpu_config, cpu_template) ;
8986
9087 let vcpu_config = VcpuConfig {
9188 vcpu_count : machine_config. vcpu_count ,
Original file line number Diff line number Diff line change @@ -49,10 +49,7 @@ impl CpuConfiguration {
4949 }
5050
5151 /// Creates new guest CPU config based on the provided template
52- pub fn apply_template (
53- mut self ,
54- template : & CustomCpuTemplate ,
55- ) -> Result < Self , CpuConfigurationError > {
52+ pub fn apply_template ( mut self , template : & CustomCpuTemplate ) -> Self {
5653 for ( modifier, mut reg) in template. reg_modifiers . iter ( ) . zip ( self . regs . iter_mut ( ) ) {
5754 match reg. size ( ) {
5855 RegSize :: U32 => {
@@ -73,7 +70,7 @@ impl CpuConfiguration {
7370 _ => unreachable ! ( "Only 32, 64 and 128 bit wide registers are supported" ) ,
7471 }
7572 }
76- Ok ( self )
73+ self
7774 }
7875
7976 /// Returns ids of registers that are changed
You can’t perform that action at this time.
0 commit comments