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: Eric Blake
Subject: Re: [RFC v5 004/126] hmp: drop Error pointer indirection in hmp_handle_error
Date: Fri, 11 Oct 2019 13:32:02 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0

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?

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



reply via email to

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