From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBh93-0002gR-Kb for qemu-devel@nongnu.org; Thu, 15 Jan 2015 04:55:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBh90-0003Aa-Dr for qemu-devel@nongnu.org; Thu, 15 Jan 2015 04:55:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBh90-00039k-7m for qemu-devel@nongnu.org; Thu, 15 Jan 2015 04:55:14 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0F9tDB3016689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Jan 2015 04:55:13 -0500 Date: Thu, 15 Jan 2015 10:55:10 +0100 From: Kevin Wolf Message-ID: <20150115095510.GB4361@noname.redhat.com> References: <1421245910-30666-1-git-send-email-armbru@redhat.com> <1421245910-30666-5-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1421245910-30666-5-git-send-email-armbru@redhat.com> 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 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()? Kevin