qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

error: Reduce unnecessary error propagation

When all we do with an Error we receive into a local variable is
propagating to somewhere else, we can just as well receive it there
right away, even when we need to keep error_propagate() for other
error paths.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-38-armbru@redhat.com>

+13 -14
+1 -1
block.c
··· 6058 6058 6059 6059 /* Parse -o options */ 6060 6060 if (options) { 6061 - if (!qemu_opts_do_parse(opts, options, NULL, &local_err)) { 6061 + if (!qemu_opts_do_parse(opts, options, NULL, errp)) { 6062 6062 goto out; 6063 6063 } 6064 6064 }
+4 -4
block/gluster.c
··· 523 523 524 524 /* create opts info from runtime_json_opts list */ 525 525 opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort); 526 - if (!qemu_opts_absorb_qdict(opts, options, &local_err)) { 526 + if (!qemu_opts_absorb_qdict(opts, options, errp)) { 527 527 goto out; 528 528 } 529 529 ··· 554 554 555 555 /* create opts info from runtime_type_opts list */ 556 556 opts = qemu_opts_create(&runtime_type_opts, NULL, 0, &error_abort); 557 - if (!qemu_opts_absorb_qdict(opts, backing_options, &local_err)) { 557 + if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) { 558 558 goto out; 559 559 } 560 560 ··· 584 584 if (gsconf->type == SOCKET_ADDRESS_TYPE_INET) { 585 585 /* create opts info from runtime_inet_opts list */ 586 586 opts = qemu_opts_create(&runtime_inet_opts, NULL, 0, &error_abort); 587 - if (!qemu_opts_absorb_qdict(opts, backing_options, &local_err)) { 587 + if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) { 588 588 goto out; 589 589 } 590 590 ··· 632 632 } else { 633 633 /* create opts info from runtime_unix_opts list */ 634 634 opts = qemu_opts_create(&runtime_unix_opts, NULL, 0, &error_abort); 635 - if (!qemu_opts_absorb_qdict(opts, backing_options, &local_err)) { 635 + if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) { 636 636 goto out; 637 637 } 638 638
+1 -1
block/parallels.c
··· 828 828 goto fail_options; 829 829 } 830 830 831 - if (!qemu_opts_absorb_qdict(opts, options, &local_err)) { 831 + if (!qemu_opts_absorb_qdict(opts, options, errp)) { 832 832 goto fail_options; 833 833 } 834 834
+1 -1
block/quorum.c
··· 921 921 } 922 922 923 923 opts = qemu_opts_create(&quorum_runtime_opts, NULL, 0, &error_abort); 924 - if (!qemu_opts_absorb_qdict(opts, options, &local_err)) { 924 + if (!qemu_opts_absorb_qdict(opts, options, errp)) { 925 925 ret = -EINVAL; 926 926 goto exit; 927 927 }
+1 -2
block/replication.c
··· 85 85 { 86 86 int ret; 87 87 BDRVReplicationState *s = bs->opaque; 88 - Error *local_err = NULL; 89 88 QemuOpts *opts = NULL; 90 89 const char *mode; 91 90 const char *top_id; ··· 99 98 100 99 ret = -EINVAL; 101 100 opts = qemu_opts_create(&replication_runtime_opts, NULL, 0, &error_abort); 102 - if (!qemu_opts_absorb_qdict(opts, options, &local_err)) { 101 + if (!qemu_opts_absorb_qdict(opts, options, errp)) { 103 102 goto fail; 104 103 } 105 104
+2 -2
block/vxhs.c
··· 318 318 opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); 319 319 tcp_opts = qemu_opts_create(&runtime_tcp_opts, NULL, 0, &error_abort); 320 320 321 - if (!qemu_opts_absorb_qdict(opts, options, &local_err)) { 321 + if (!qemu_opts_absorb_qdict(opts, options, errp)) { 322 322 ret = -EINVAL; 323 323 goto out; 324 324 } ··· 345 345 /* get the 'server.' arguments */ 346 346 qdict_extract_subqdict(options, &backing_options, VXHS_OPT_SERVER"."); 347 347 348 - if (!qemu_opts_absorb_qdict(tcp_opts, backing_options, &local_err)) { 348 + if (!qemu_opts_absorb_qdict(tcp_opts, backing_options, errp)) { 349 349 ret = -EINVAL; 350 350 goto out; 351 351 }
+1 -1
hw/core/qdev.c
··· 871 871 } 872 872 873 873 if (value && !dev->realized) { 874 - if (!check_only_migratable(obj, &local_err)) { 874 + if (!check_only_migratable(obj, errp)) { 875 875 goto fail; 876 876 } 877 877
+2 -2
hw/net/virtio-net.c
··· 3138 3138 qdev_set_parent_bus(n->primary_dev, n->primary_bus); 3139 3139 n->primary_should_be_hidden = false; 3140 3140 if (!qemu_opt_set_bool(n->primary_device_opts, 3141 - "partially_hotplugged", true, &err)) { 3142 - goto out; 3141 + "partially_hotplugged", true, errp)) { 3142 + return false; 3143 3143 } 3144 3144 hotplug_ctrl = qdev_get_hotplug_handler(n->primary_dev); 3145 3145 if (hotplug_ctrl) {