qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC v5 004/126] hmp: drop Error pointer indirection in hmp_handle_e


From: Dr. David Alan Gilbert
Subject: Re: [RFC v5 004/126] hmp: drop Error pointer indirection in hmp_handle_error
Date: Fri, 11 Oct 2019 19:35:58 +0100
User-agent: Mutt/1.12.1 (2019-06-15)

* Eric Blake (address@hidden) wrote:
> On 10/11/19 11:03 AM, Vladimir Sementsov-Ogievskiy wrote:
> > We don't need Error **, as all callers pass local Error object, which
> > isn't used after the call. Use Error * instead.
> > 
> > Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> > ---
> >   include/monitor/hmp.h      |   2 +-
> >   dump/dump-hmp-cmds.c       |   4 +-
> >   hw/core/machine-hmp-cmds.c |   6 +-
> >   monitor/hmp-cmds.c         | 155 ++++++++++++++++++-------------------
> >   qdev-monitor.c             |   4 +-
> >   qom/qom-hmp-cmds.c         |   4 +-
> >   6 files changed, 87 insertions(+), 88 deletions(-)
> > 
> 
> > +++ b/dump/dump-hmp-cmds.c
> > @@ -32,7 +32,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict 
> > *qdict)
> >       if (zlib + lzo + snappy + win_dmp > 1) {
> >           error_setg(&err, "only one of '-z|-l|-s|-w' can be set");
> > -        hmp_handle_error(mon, &err);
> > +        hmp_handle_error(mon, err);
> >           return;
> >       }
> 
> Probably not for this series, but would a patch to various HMP files to have
> a g_auto() sort of reporting on an error the moment it goes out of scope
> (rather than having to manually call hmp_handle_error() everywhere) make
> sense?

Maybe; although lets be a bit careful just how much we hide behind
g_auto.

Dave

> -- 
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3226
> Virtualization:  qemu.org | libvirt.org
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

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