[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RHEL-7.3 qemu-kvm-rhev PATCH] qmp: Report drive_add error

From: Fam Zheng
Subject: [Qemu-devel] [RHEL-7.3 qemu-kvm-rhev PATCH] qmp: Report drive_add error to monitor
Date: Thu, 19 May 2016 14:39:44 +0800

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

Signed-off-by: Fam Zheng <address@hidden>
 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));

reply via email to

[Prev in Thread] Current Thread [Next in Thread]