cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-fw_cfg-Improve-error-message-when-can-t-load-splash-.patch

4ec855
From f11136998ed22e121b0a9df26f83e252bd5918fa Mon Sep 17 00:00:00 2001
4ec855
From: Markus Armbruster <armbru@redhat.com>
4ec855
Date: Mon, 7 Oct 2019 07:35:06 +0100
4ec855
Subject: [PATCH 13/22] fw_cfg: Improve error message when can't load splash
4ec855
 file
4ec855
MIME-Version: 1.0
4ec855
Content-Type: text/plain; charset=UTF-8
4ec855
Content-Transfer-Encoding: 8bit
4ec855
4ec855
RH-Author: Markus Armbruster <armbru@redhat.com>
4ec855
Message-id: <20191007073509.5887-2-armbru@redhat.com>
4ec855
Patchwork-id: 90978
4ec855
O-Subject: [RHEL-8.2.0 qemu-kvm PATCH v2 1/4] fw_cfg: Improve error message when can't load splash file
4ec855
Bugzilla: 1607367
4ec855
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
4ec855
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
4ec855
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
4ec855
4ec855
From: Li Qiang <liq3ea@gmail.com>
4ec855
4ec855
read_splashfile() reports "failed to read splash file" without
4ec855
further details. Get the details from g_file_get_contents(), and
4ec855
include them in the error message. Also remove unnecessary 'res'
4ec855
variable.
4ec855
4ec855
Signed-off-by: Li Qiang <liq3ea@gmail.com>
4ec855
Reviewed-by: Markus Armbruster <armbru@redhat.com>
4ec855
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
4ec855
Message-Id: <1541052148-28752-1-git-send-email-liq3ea@gmail.com>
4ec855
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
4ec855
(cherry picked from commit bed66336771ecdcb788d394bdd081a78b843e509)
4ec855
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
4ec855
---
4ec855
 hw/nvram/fw_cfg.c | 7 +++----
4ec855
 1 file changed, 3 insertions(+), 4 deletions(-)
4ec855
4ec855
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
4ec855
index 2a0739d..d35ac7b 100644
4ec855
--- a/hw/nvram/fw_cfg.c
4ec855
+++ b/hw/nvram/fw_cfg.c
4ec855
@@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize *file_sizep,
4ec855
                              int *file_typep)
4ec855
 {
4ec855
     GError *err = NULL;
4ec855
-    gboolean res;
4ec855
     gchar *content;
4ec855
     int file_type;
4ec855
     unsigned int filehead;
4ec855
     int bmp_bpp;
4ec855
 
4ec855
-    res = g_file_get_contents(filename, &content, file_sizep, &err;;
4ec855
-    if (res == FALSE) {
4ec855
-        error_report("failed to read splash file '%s'", filename);
4ec855
+    if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
4ec855
+        error_report("failed to read splash file '%s': %s",
4ec855
+                     filename, err->message);
4ec855
         g_error_free(err);
4ec855
         return NULL;
4ec855
     }
4ec855
-- 
4ec855
1.8.3.1
4ec855