All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RHEL-7.3 qemu-kvm-rhev PATCH] qmp: Report drive_add error to monitor
@ 2016-05-19  6:39 Fam Zheng
  2016-05-20  8:13 ` Markus Armbruster
  0 siblings, 1 reply; 2+ messages in thread
From: Fam Zheng @ 2016-05-19  6:39 UTC (permalink / raw)
  To: rhvirt-patches
  Cc: Markus Armbruster, Kevin Wolf, Fam Zheng, Max Reitz, qemu-devel,
	stefanha, jcody

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1337100
Brew: 11051815
Upstream: N/A

In other error cases of this function we use error_setg, the same should
be done with drive_new() failures. This is useful for libvirt to
correctly detect the failure and report proper error message when a
specified image is not available.

This bug cames from the forward porting from qemu-kvm, at which point we
overlooked the difference in QMP reporting between qerror_report and
error_report.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 device-hotplug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/device-hotplug.c b/device-hotplug.c
index 12c17e5..883346e 100644
--- a/device-hotplug.c
+++ b/device-hotplug.c
@@ -145,8 +145,7 @@ void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp)
     mc = MACHINE_GET_CLASS(current_machine);
     dinfo = drive_new(opts, mc->block_default_type);
     if (!dinfo) {
-        error_report(QERR_DEVICE_INIT_FAILED,
-                      qemu_opts_id(opts));
+        error_setg(errp, QERR_DEVICE_INIT_FAILED, qemu_opts_id(opts));
         qemu_opts_del(opts);
         return;
     }
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-20  8:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-19  6:39 [Qemu-devel] [RHEL-7.3 qemu-kvm-rhev PATCH] qmp: Report drive_add error to monitor Fam Zheng
2016-05-20  8:13 ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.