File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -107,8 +107,12 @@ impl TryFrom<ScmiArgs> for VuScmiConfig {
107
107
fn start_backend ( config : VuScmiConfig ) -> Result < ( ) > {
108
108
loop {
109
109
debug ! ( "Starting backend" ) ;
110
- // TODO: Print a nice error message on backend configuration failure.
111
- let backend = Arc :: new ( RwLock :: new ( VuScmiBackend :: new ( & config) . unwrap ( ) ) ) ;
110
+ let backend_instance = VuScmiBackend :: new ( & config) ;
111
+ if let Err ( error) = backend_instance {
112
+ return Err ( error. to_string ( ) ) ;
113
+ }
114
+
115
+ let backend = Arc :: new ( RwLock :: new ( backend_instance. unwrap ( ) ) ) ;
112
116
let listener = Listener :: new ( config. socket_path . clone ( ) , true ) . unwrap ( ) ;
113
117
let mut daemon = VhostUserDaemon :: new (
114
118
"vhost-device-scmi" . to_owned ( ) ,
@@ -163,6 +167,7 @@ fn main() {
163
167
Ok ( config) => {
164
168
if let Err ( error) = start_backend ( config) {
165
169
error ! ( "{error}" ) ;
170
+ println ! ( "{error}" ) ;
166
171
exit ( 1 ) ;
167
172
}
168
173
}
You can’t perform that action at this time.
0 commit comments