From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, fromani@redhat.com, stefanha@redhat.com,
qemu-block@nongnu.org
Subject: [Qemu-devel] [PATCH] block: Fix block-set-write-threshold not to use funky error class
Date: Fri, 13 Mar 2015 18:51:38 +0100 [thread overview]
Message-ID: <1426269098-16043-1-git-send-email-armbru@redhat.com> (raw)
Error classes are a leftover from the days of "rich" error objects.
New code should always use ERROR_CLASS_GENERIC_ERROR. Commit e246211
added a use of ERROR_CLASS_DEVICE_NOT_FOUND. Replace it.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
block/write-threshold.c | 2 +-
qapi/block-core.json | 4 ----
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/write-threshold.c b/block/write-threshold.c
index c2cd517..a53c1f5 100644
--- a/block/write-threshold.c
+++ b/block/write-threshold.c
@@ -112,7 +112,7 @@ void qmp_block_set_write_threshold(const char *node_name,
bs = bdrv_find_node(node_name);
if (!bs) {
- error_set(errp, QERR_DEVICE_NOT_FOUND, node_name);
+ error_setg(errp, "Device '%s' not found", node_name);
return;
}
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 90586a5..42c8850 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1961,10 +1961,6 @@
# @write-threshold: configured threshold for the block device, bytes.
# Use 0 to disable the threshold.
#
-# Returns: Nothing on success
-# If @node name is not found on the block device graph,
-# DeviceNotFound
-#
# Since: 2.3
##
{ 'command': 'block-set-write-threshold',
--
1.9.3
next reply other threads:[~2015-03-13 17:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-13 17:51 Markus Armbruster [this message]
2015-03-13 19:11 ` [Qemu-devel] [PATCH] block: Fix block-set-write-threshold not to use funky error class Eric Blake
2015-03-13 20:17 ` Markus Armbruster
2015-03-16 15:04 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1426269098-16043-1-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=fromani@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).