File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -664,9 +664,18 @@ impl Qemu {
664664 let qmp_info = match qmp. handshake ( ) {
665665 Ok ( i) => i,
666666 Err ( e) => {
667- let _ = self
668- . updates
669- . send ( Output :: BootEnd ( Err ( e) . context ( "QMP handshake failed" ) ) ) ;
667+ // If the handshake failed, grab stderr from qemu and display it
668+ // to assist with debugging
669+ let mut err = String :: new ( ) ;
670+ // unwrap() should never fail b/c we are capturing stdout
671+ let mut stderr = child. stderr . take ( ) . unwrap ( ) ;
672+ if let Err ( e) = stderr. read_to_string ( & mut err) {
673+ err += & format ! ( "<failed to read stderr: {}>" , e) ;
674+ }
675+
676+ let _ = self . updates . send ( Output :: BootEnd (
677+ Err ( e) . context ( "QMP handshake failed" ) . context ( err) ,
678+ ) ) ;
670679 return ;
671680 }
672681 } ;
You can’t perform that action at this time.
0 commit comments