qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/4] block: Eliminate silly QERR_ macros used fo


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 4/4] block: Eliminate silly QERR_ macros used for encryption keys
Date: Thu, 15 Jan 2015 13:49:18 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 15.01.2015 um 13:40 hat Markus Armbruster geschrieben:
> Kevin Wolf <address@hidden> 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 <address@hidden>
> >> ---
> >>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]