qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH 18/46] qemu-option: Smooth error checking manually


From: Eric Blake
Subject: Re: [PATCH 18/46] qemu-option: Smooth error checking manually
Date: Wed, 24 Jun 2020 15:10:47 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 6/24/20 11:43 AM, Markus Armbruster wrote:
When foo(..., &err) is followed by error_propagate(errp, err), we can
often just as well do foo(..., errp).  The previous commit did that
for simple cases with Coccinelle.  Do it for a few more manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
  block.c             | 2 +-
  block/gluster.c     | 8 ++++----
  block/parallels.c   | 2 +-
  block/quorum.c      | 2 +-
  block/replication.c | 2 +-
  block/vxhs.c        | 4 ++--
  hw/net/virtio-net.c | 4 ++--
  7 files changed, 12 insertions(+), 12 deletions(-)


+++ b/block/gluster.c
@@ -523,7 +523,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster 
*gconf,
/* create opts info from runtime_json_opts list */
      opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort);
-    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
          goto out;
      }

This function also has a few error_setg(&local_err) that could be cleaned up to error_setg(errp); but the ones that use error_append_hint() immediately after (and thus the error_propagate(errp, local_err) in the out: label) still have to remain, until we have Vladimir's macro in place.

Reviewed-by: Eric Blake <eblake@redhat.com>

--
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]