Received: from eggs.gnu.org ([2001:4830:134:3::10]:35671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBjie-0000vs-Oj for qemu-devel@nongnu.org; Thu, 15 Jan 2015 07:40:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBjib-0001Jd-AM for qemu-devel@nongnu.org; Thu, 15 Jan 2015 07:40:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBjib-0001J7-3d for qemu-devel@nongnu.org; Thu, 15 Jan 2015 07:40:09 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0FCe7Ve007212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Jan 2015 07:40:07 -0500 From: Markus Armbruster References: <1421245910-30666-1-git-send-email-armbru@redhat.com> <1421245910-30666-5-git-send-email-armbru@redhat.com> <20150115095510.GB4361@noname.redhat.com> Date: Thu, 15 Jan 2015 13:40:05 +0100 In-Reply-To: <20150115095510.GB4361@noname.redhat.com> (Kevin Wolf's message of "Thu, 15 Jan 2015 10:55:10 +0100") Message-ID: <874mrs1al6.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 4/4] block: Eliminate silly QERR_ macros used for encryption keys List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, stefanha@redhat.com Kevin Wolf writes: > Am 14.01.2015 um 15:31 hat Markus Armbruster geschrieben: >> The QERR_ macros are leftovers from the days of "rich" error objects. >> They're used with error_set() and qerror_report(), and expand into the >> first *two* arguments. This trickiness has become pointless. Clean >> up QERR_DEVICE_ENCRYPTED and QERR_DEVICE_NOT_ENCRYPTED. >> >> Signed-off-by: Markus Armbruster >> --- >> block.c | 6 ++++-- >> include/qapi/qmp/qerror.h | 6 ------ >> 2 files changed, 4 insertions(+), 8 deletions(-) >> >> diff --git a/block.c b/block.c >> index ba005f3..4cf6d29 100644 >> --- a/block.c >> +++ b/block.c >> @@ -3737,14 +3737,16 @@ void bdrv_add_key(BlockDriverState *bs, const char *key, Error **errp) >> { >> if (key) { >> if (!bdrv_is_encrypted(bs)) { >> - error_set(errp, QERR_DEVICE_NOT_ENCRYPTED, >> + error_set(errp, ERROR_CLASS_GENERIC_ERROR, >> + "Device '%s' is not encrypted", >> bdrv_get_device_name(bs)); > > Why not error_setg()? Because I forgot? I'll respin unless you prefer to fix it up on commit.