Blame SOURCES/kvm-qemu-img-fix-error-reporting-for-object.patch

7711c0
From 021b459bdd231286b9029da55fc7847cd338d66e Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Fri, 5 Apr 2019 21:41:02 +0200
7711c0
Subject: [PATCH 096/163] qemu-img: fix error reporting for -object
7711c0
MIME-Version: 1.0
7711c0
Content-Type: text/plain; charset=UTF-8
7711c0
Content-Transfer-Encoding: 8bit
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190405214102.17467-1-jsnow@redhat.com>
7711c0
Patchwork-id: 85467
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 21.5/55] qemu-img: fix error reporting for -object
7711c0
Bugzilla: 1691009
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
7711c0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
7711c0
From: Daniel P. Berrangé <berrange@redhat.com>
7711c0
7711c0
Error reporting for user_creatable_add_opts_foreach was changed so that
7711c0
it no longer called 'error_report_err' in:
7711c0
7711c0
  commit 7e1e0c11127bde81cff260fc6859690435c509d6
7711c0
  Author: Markus Armbruster <armbru@redhat.com>
7711c0
  Date:   Wed Oct 17 10:26:43 2018 +0200
7711c0
7711c0
    qom: Clean up error reporting in user_creatable_add_opts_foreach()
7711c0
7711c0
Some callers were updated to pass in "&error_fatal" but all the ones in
7711c0
qemu-img were left passing NULL. As a result all errors went to
7711c0
/dev/null instead of being reported to the user.
7711c0
7711c0
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7711c0
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
7711c0
Reviewed-by: Markus Armbruster <armbru@redhat.com>
7711c0
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
7711c0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7711c0
(cherry picked from commit 334c43e2c342e878311c66b4e62343f0a7c2c6be)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 qemu-img.c | 26 +++++++++++++-------------
7711c0
 1 file changed, 13 insertions(+), 13 deletions(-)
7711c0
7711c0
diff --git a/qemu-img.c b/qemu-img.c
7711c0
index fa0cbd7..3b147ca 100644
7711c0
--- a/qemu-img.c
7711c0
+++ b/qemu-img.c
7711c0
@@ -505,7 +505,7 @@ static int img_create(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         goto fail;
7711c0
     }
7711c0
 
7711c0
@@ -755,7 +755,7 @@ static int img_check(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         return 1;
7711c0
     }
7711c0
 
7711c0
@@ -968,7 +968,7 @@ static int img_commit(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         return 1;
7711c0
     }
7711c0
 
7711c0
@@ -1327,7 +1327,7 @@ static int img_compare(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         ret = 2;
7711c0
         goto out4;
7711c0
     }
7711c0
@@ -2132,7 +2132,7 @@ static int img_convert(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         goto fail_getopt;
7711c0
     }
7711c0
 
7711c0
@@ -2684,7 +2684,7 @@ static int img_info(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         return 1;
7711c0
     }
7711c0
 
7711c0
@@ -2903,7 +2903,7 @@ static int img_map(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         return 1;
7711c0
     }
7711c0
 
7711c0
@@ -3052,7 +3052,7 @@ static int img_snapshot(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         return 1;
7711c0
     }
7711c0
 
7711c0
@@ -3212,7 +3212,7 @@ static int img_rebase(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         return 1;
7711c0
     }
7711c0
 
7711c0
@@ -3592,7 +3592,7 @@ static int img_resize(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         return 1;
7711c0
     }
7711c0
 
7711c0
@@ -3836,7 +3836,7 @@ static int img_amend(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         ret = -1;
7711c0
         goto out_no_progress;
7711c0
     }
7711c0
@@ -4480,7 +4480,7 @@ static int img_dd(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         ret = -1;
7711c0
         goto out;
7711c0
     }
7711c0
@@ -4757,7 +4757,7 @@ static int img_measure(int argc, char **argv)
7711c0
 
7711c0
     if (qemu_opts_foreach(&qemu_object_opts,
7711c0
                           user_creatable_add_opts_foreach,
7711c0
-                          NULL, NULL)) {
7711c0
+                          NULL, &error_fatal)) {
7711c0
         goto out;
7711c0
     }
7711c0
 
7711c0
-- 
7711c0
1.8.3.1
7711c0