From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBjrb-0004MM-5B for qemu-devel@nongnu.org; Thu, 15 Jan 2015 07:49:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBjrW-0004NV-3W for qemu-devel@nongnu.org; Thu, 15 Jan 2015 07:49:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBjrV-0004NP-Sc for qemu-devel@nongnu.org; Thu, 15 Jan 2015 07:49:22 -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 t0FCnKBi025462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Jan 2015 07:49:20 -0500 Date: Thu, 15 Jan 2015 13:49:18 +0100 From: Kevin Wolf Message-ID: <20150115124918.GD4361@noname.redhat.com> References: <1421245910-30666-1-git-send-email-armbru@redhat.com> <1421245910-30666-5-git-send-email-armbru@redhat.com> <20150115095510.GB4361@noname.redhat.com> <874mrs1al6.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874mrs1al6.fsf@blackfin.pond.sub.org> 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: Markus Armbruster Cc: qemu-devel@nongnu.org, stefanha@redhat.com Am 15.01.2015 um 13:40 hat Markus Armbruster geschrieben: > 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. I would fix it on commit, but it's Stefan's week, so whatever he prefers. Kevin