Blame SOURCES/0024-qmp-Report-__com.redhat_drive_add-error-to-monitor.patch

4a2fec
From d6db718295b53f11017aaba1dd8a0507c77d7a1e Mon Sep 17 00:00:00 2001
4a2fec
From: Fam Zheng <famz@redhat.com>
4a2fec
Date: Thu, 19 May 2016 06:39:44 +0200
4a2fec
Subject: qmp: Report __com.redhat_drive_add error to monitor
4a2fec
4a2fec
RH-Author: Fam Zheng <famz@redhat.com>
4a2fec
Message-id: <1463639984-1165-1-git-send-email-famz@redhat.com>
4a2fec
Patchwork-id: 70412
4a2fec
O-Subject: [RHEL-7.3 qemu-kvm-rhev PATCH] qmp: Report drive_add error to monitor
4a2fec
Bugzilla: 1337100
4a2fec
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
4a2fec
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
4a2fec
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
4a2fec
4a2fec
In other error cases of this function we use error_setg, the same should
4a2fec
be done with drive_new() failures. This is useful for libvirt to
4a2fec
correctly detect the failure and report proper error message when a
4a2fec
specified image is not available.
4a2fec
4a2fec
This bug cames from the forward porting from qemu-kvm, at which point we
4a2fec
overlooked the difference in QMP reporting between qerror_report and
4a2fec
error_report.
4a2fec
4a2fec
Signed-off-by: Fam Zheng <famz@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
(cherry picked from commit c5736179da1a310ddb384836fc025b2582f9e90d)
4a2fec
4a2fec
Rebase notes (2.8.0):
4a2fec
- Changed patch name
4a2fec
4a2fec
(cherry picked from commit 8a1f601ec13449e736c05789c4f5ae52ab34f3a7)
4a2fec
---
4a2fec
 device-hotplug.c | 3 +--
4a2fec
 1 file changed, 1 insertion(+), 2 deletions(-)
4a2fec
4a2fec
diff --git a/device-hotplug.c b/device-hotplug.c
4a2fec
index 218f7b3..29f9a64 100644
4a2fec
--- a/device-hotplug.c
4a2fec
+++ b/device-hotplug.c
4a2fec
@@ -145,8 +145,7 @@ void qmp_simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp)
4a2fec
     mc = MACHINE_GET_CLASS(current_machine);
4a2fec
     dinfo = drive_new(opts, mc->block_default_type);
4a2fec
     if (!dinfo) {
4a2fec
-        error_report(QERR_DEVICE_INIT_FAILED,
4a2fec
-                      qemu_opts_id(opts));
4a2fec
+        error_setg(errp, QERR_DEVICE_INIT_FAILED, qemu_opts_id(opts));
4a2fec
         qemu_opts_del(opts);
4a2fec
         return;
4a2fec
     }
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec