[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg file fa
From: |
Li Qiang |
Subject: |
[Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg file failed |
Date: |
Mon, 8 Oct 2018 19:39:20 -0700 |
It makes sense to print the error message while reading
file failed.
Change since v1:
free error
Signed-off-by: Li Qiang <address@hidden>
Reviewed-by: Philippe Mathieu-Daud?? <address@hidden>
---
vl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index 4e25c78..69fc77c 100644
--- a/vl.c
+++ b/vl.c
@@ -2207,8 +2207,10 @@ 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);
+ g_error_free(error);
return -1;
}
}
--
1.8.3.1
- [Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg file failed,
Li Qiang <=