[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] vl.c: print error message if load fw_cfg file faile
From: |
Li Qiang |
Subject: |
[Qemu-devel] [PATCH] vl.c: print error message if load fw_cfg file failed |
Date: |
Sat, 6 Oct 2018 21:33:35 -0700 |
It makes sense to print the error message while reading
file failed.
Signed-off-by: Li Qiang <address@hidden>
---
vl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index cc55fe04a2..3db410e771 100644
--- a/vl.c
+++ b/vl.c
@@ -2207,8 +2207,9 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts,
Error **errp)
size = strlen(str); /* NUL terminator NOT included in fw_cfg blob */
buf = g_memdup(str, size);
} else {
- if (!g_file_get_contents(file, &buf, &size, NULL)) {
- error_report("can't load %s", file);
+ GError *error = NULL;
+ if (!g_file_get_contents(file, &buf, &size, &error)) {
+ error_report("can't load %s, %s", file, error->message);
return -1;
}
}
--
2.17.1
- [Qemu-devel] [PATCH] vl.c: print error message if load fw_cfg file failed,
Li Qiang <=