[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/4] fw_cfg: Improve error message when can't load sp
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PULL 1/4] fw_cfg: Improve error message when can't load splash file |
Date: |
Fri, 4 Jan 2019 17:25:56 +0100 |
From: Li Qiang <address@hidden>
read_splashfile() reports "failed to read splash file" without
further details. Get the details from g_file_get_contents(), and
include them in the error message. Also remove unnecessary 'res'
variable.
Signed-off-by: Li Qiang <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/nvram/fw_cfg.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 3cb726ff68..9c4409be5e 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize
*file_sizep,
int *file_typep)
{
GError *err = NULL;
- gboolean res;
gchar *content;
int file_type;
unsigned int filehead;
int bmp_bpp;
- res = g_file_get_contents(filename, &content, file_sizep, &err);
- if (res == FALSE) {
- error_report("failed to read splash file '%s'", filename);
+ if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
+ error_report("failed to read splash file '%s': %s",
+ filename, err->message);
g_error_free(err);
return NULL;
}
--
2.17.2