Blame SOURCES/kvm-blockdev-Report-proper-error-class-in-__com.redhat.d.patch

4a2fec
From bacc2236309db4099bbbfe7125efaa7ad83739d8 Mon Sep 17 00:00:00 2001
4a2fec
From: Eric Blake <eblake@redhat.com>
4a2fec
Date: Fri, 1 Dec 2017 03:12:21 +0100
4a2fec
Subject: [PATCH 09/36] blockdev: Report proper error class in
4a2fec
 __com.redhat.drive_del
4a2fec
4a2fec
RH-Author: Eric Blake <eblake@redhat.com>
4a2fec
Message-id: <20171201031221.26738-1-eblake@redhat.com>
4a2fec
Patchwork-id: 78060
4a2fec
O-Subject: [RHEV-7.5 qemu-kvm-rhev PATCH] blockdev: Report proper error class in __com.redhat.drive_del
4a2fec
Bugzilla: 1487515
4a2fec
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
4a2fec
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
4a2fec
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
4a2fec
4a2fec
From: Eric Blake 
4a2fec
4a2fec
Libvirt expects 'DeviceNotFound' to suppress the error message rather
4a2fec
than the generic error.  If the wrong error class is used, the libvirt
4a2fec
spams /var/log/messages with a spurious message during hot-unplug:
4a2fec
4a2fec
  Aug 30 20:03:32 rhosp8-test libvirtd: 2017-08-30 11:03:32.354+0000: 2562: error : qemuMonitorJSONCheckError:389 : internal error: unable to execute QEMU command '__com.redhat_drive_del': Device 'drive-virtio-disk1' not found
4a2fec
4a2fec
Fixes: 60b62c9d
4a2fec
4a2fec
Diagnosis of the issue performed by Peter Krempa.
4a2fec
4a2fec
Signed-off-by: Eric Blake <eblake@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 blockdev.c | 3 ++-
4a2fec
 1 file changed, 2 insertions(+), 1 deletion(-)
4a2fec
4a2fec
diff --git a/blockdev.c b/blockdev.c
4a2fec
index 0f063ec..6a37934 100644
4a2fec
--- a/blockdev.c
4a2fec
+++ b/blockdev.c
4a2fec
@@ -2909,7 +2909,8 @@ void qmp___com_redhat_drive_del(const char *id, Error **errp)
4a2fec
 
4a2fec
     blk = blk_by_name(id);
4a2fec
     if (!blk) {
4a2fec
-        error_setg(errp, "Device '%s' not found", id);
4a2fec
+        error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
4a2fec
+                  "Device '%s' not found", id);
4a2fec
         return;
4a2fec
     }
4a2fec
 
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec