Fix crash at startup
PATCH 1/1 Fix crash at startup
Fix crash at startup
Signed-off-by Lionel Landwerlin <[email protected]>
--- exec.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
exec.c +0 -0
@@ -2066,2 +2066,2 @@ void page_dump(FILE *f)int i, j, prot, prot1;PageDesc *p;
+ if (!f)
+ return;
+
fprintf(f, "%-8s %-8s %-8s %s\n",
"start", "end", "size", "prot");
start = -1;--
1.5.6.5
Quoted 12 lines · Lionel Landwerlin
Fix crash at startup
Signed-off-by Lionel Landwerlin <[email protected]>--- exec.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)exec.c +0
-0
exec.c void page_dump(FILE *f)
Quoted 6 lines
exec.c +3
-0@@ -2066,2 +2066,2 @@ void page_dump(FILE *f)int i, j, prot, prot1;PageDesc *p; +if (!f) +return ; +
I would prefer a slightly different approach like the attached patch, but that's just personal taste :-)
Laurent
Signed-off-by Laurent Desnogues <[email protected]>
qemu-log.h +4 -2
@@ -63,10 +63,12 @@disas (logfile, (start), (len)) /* page_dump() output to the log file: */ -#define log_page_dump () page_dump(logfile) +#define log_page_dump () do { \ + if (logfile) \ + page_dump(logfile); \ + } while (0) -/* Maintenance: */ /* fflush() the log file */