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 {
53
53
VcpuConfig ( CpuConfigurationError ) ,
54
54
/// Error configuring the vcpu: {0}
55
55
VcpuConfigure ( KvmVcpuError ) ,
56
- /// Error applying vcpu template: {0}
57
- VcpuApplyTemplate ( CpuConfigurationError ) ,
58
56
}
59
57
60
58
/// The start of the memory area reserved for MMIO devices.
@@ -84,8 +82,7 @@ pub fn configure_system_for_boot(
84
82
CpuConfiguration :: new ( cpu_template, vcpus) . map_err ( ConfigurationError :: VcpuConfig ) ?;
85
83
86
84
// 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) ;
89
86
90
87
let vcpu_config = VcpuConfig {
91
88
vcpu_count : machine_config. vcpu_count ,
Original file line number Diff line number Diff line change @@ -49,10 +49,7 @@ impl CpuConfiguration {
49
49
}
50
50
51
51
/// 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 {
56
53
for ( modifier, mut reg) in template. reg_modifiers . iter ( ) . zip ( self . regs . iter_mut ( ) ) {
57
54
match reg. size ( ) {
58
55
RegSize :: U32 => {
@@ -73,7 +70,7 @@ impl CpuConfiguration {
73
70
_ => unreachable ! ( "Only 32, 64 and 128 bit wide registers are supported" ) ,
74
71
}
75
72
}
76
- Ok ( self )
73
+ self
77
74
}
78
75
79
76
/// Returns ids of registers that are changed
You can’t perform that action at this time.
0 commit comments