diff mbox series

mambo: print useful error when mysim mmap fails

Message ID 20220805220223.576936-1-grimm@linux.ibm.com
State Accepted
Headers show
Series mambo: print useful error when mysim mmap fails | expand

Checks

Context Check Description
snowpatch_ozlabs/github-Docker_builds_and_checks success Successfully ran 9 jobs.

Commit Message

Ryan Grimm Aug. 5, 2022, 10:02 p.m. UTC
My user id didn't have access to disk.img and the code printed
the error message:

ERROR: pmem: 'mysim mmap' command needs newer mambo

mysim mmap has been in Mambo for a while so this patch prints out the
error message from catch.  Now we get the useful:

ERROR: pmem: 'mysim mmap' Error opening file disk.img for mapping

Signed-off-by: Ryan Grimm <grimm@linux.ibm.com>
---
 external/mambo/skiboot.tcl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dan Horák Aug. 8, 2022, 5:11 p.m. UTC | #1
On Fri,  5 Aug 2022 18:02:23 -0400
Ryan Grimm <grimm@linux.ibm.com> wrote:

> My user id didn't have access to disk.img and the code printed
> the error message:
> 
> ERROR: pmem: 'mysim mmap' command needs newer mambo
> 
> mysim mmap has been in Mambo for a while so this patch prints out the
> error message from catch.  Now we get the useful:
> 
> ERROR: pmem: 'mysim mmap' Error opening file disk.img for mapping
> 
> Signed-off-by: Ryan Grimm <grimm@linux.ibm.com>

LGTM

Reviewed-by: Dan Horák <dan@danny.cz>


		Dan

> ---
>  external/mambo/skiboot.tcl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
> index 33a892d9..6c0eb5a0 100644
> --- a/external/mambo/skiboot.tcl
> +++ b/external/mambo/skiboot.tcl
> @@ -364,8 +364,8 @@ foreach pmem_file $pmem_files { # PMEM_DISK
>      } else {
>  	set pmem_mode "rw"
>      }
> -    if {[catch {mysim memory mmap $pmem_start $pmem_size $pmem_file $pmem_mode}]} {
> -	puts "ERROR: pmem: 'mysim mmap' command needs newer mambo"
> +    if {[catch {mysim memory mmap $pmem_start $pmem_size $pmem_file $pmem_mode} err]} {
> +	puts "ERROR: pmem: 'mysim mmap' $err"
>  	exit
>      }
>      set pmem_start [pmem_node_add $pmem_root $pmem_start $pmem_size]
> -- 
> 2.31.1
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
Reza Arbab Aug. 23, 2022, 4:16 p.m. UTC | #2
On Fri, Aug 05, 2022 at 06:02:23PM -0400, Ryan Grimm wrote:
>My user id didn't have access to disk.img and the code printed
>the error message:
>
>ERROR: pmem: 'mysim mmap' command needs newer mambo
>
>mysim mmap has been in Mambo for a while so this patch prints out the
>error message from catch.  Now we get the useful:
>
>ERROR: pmem: 'mysim mmap' Error opening file disk.img for mapping

Applied to master.
diff mbox series

Patch

diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 33a892d9..6c0eb5a0 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -364,8 +364,8 @@  foreach pmem_file $pmem_files { # PMEM_DISK
     } else {
 	set pmem_mode "rw"
     }
-    if {[catch {mysim memory mmap $pmem_start $pmem_size $pmem_file $pmem_mode}]} {
-	puts "ERROR: pmem: 'mysim mmap' command needs newer mambo"
+    if {[catch {mysim memory mmap $pmem_start $pmem_size $pmem_file $pmem_mode} err]} {
+	puts "ERROR: pmem: 'mysim mmap' $err"
 	exit
     }
     set pmem_start [pmem_node_add $pmem_root $pmem_start $pmem_size]