qemu-e2k/hw/i386
Markus Armbruster dcfe480544 error: Avoid unnecessary error_propagate() after error_setg()
Replace

    error_setg(&err, ...);
    error_propagate(errp, err);

by

    error_setg(errp, ...);

Related pattern:

    if (...) {
        error_setg(&err, ...);
        goto out;
    }
    ...
 out:
    error_propagate(errp, err);
    return;

When all paths to label out are that way, replace by

    if (...) {
        error_setg(errp, ...);
        return;
    }

and delete the label along with the error_propagate().

When we have at most one other path that actually needs to propagate,
and maybe one at the end that where propagation is unnecessary, e.g.

    foo(..., &err);
    if (err) {
        goto out;
    }
    ...
    bar(..., &err);
 out:
    error_propagate(errp, err);
    return;

move the error_propagate() to where it's needed, like

    if (...) {
        foo(..., &err);
        error_propagate(errp, err);
        return;
    }
    ...
    bar(..., errp);
    return;

and transform the error_setg() as above.

In some places, the transformation results in obviously unnecessary
error_propagate().  The next few commits will eliminate them.

Bonus: the elimination of gotos will make later patches in this series
easier to review.

Candidates for conversion tracked down with this Coccinelle script:

    @@
    identifier err, errp;
    expression list args;
    @@
    -    error_setg(&err, args);
    +    error_setg(errp, args);
         ... when != err
         error_propagate(errp, err);

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200707160613.848843-34-armbru@redhat.com>
2020-07-10 15:18:08 +02:00
..
kvm qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
xen x86: move max-ram-below-4g to pc 2020-06-17 14:24:22 +02:00
Kconfig pc: Support for virtio-mem-pci 2020-07-03 07:57:04 -04:00
Makefile.objs acpi: create acpi-common.c and move madt code 2020-06-12 10:17:06 -04:00
acpi-build.c hyperv: vmbus: Remove the 2nd IRQ 2020-06-26 09:39:40 -04:00
acpi-build.h nvdimm: Use configurable ACPI IO base and size 2020-05-04 10:25:02 -04:00
acpi-common.c acpi: madt: skip pci override on pci-less systems. 2020-06-12 10:17:06 -04:00
acpi-common.h acpi: madt: skip pci override on pci-less systems. 2020-06-12 10:17:06 -04:00
amd_iommu.c amd_iommu: Fix amdvi_realize() error API violation 2020-07-02 11:54:47 +02:00
amd_iommu.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
e820_memory_layout.c hw/i386/pc: Extract e820 memory layout code 2019-09-16 17:13:07 +02:00
e820_memory_layout.h hw/i386/pc: Extract e820 memory layout code 2019-09-16 17:13:07 +02:00
fw_cfg.c acpi: factor out fw_cfg_add_acpi_dsdt() 2020-06-24 17:18:28 -04:00
fw_cfg.h acpi: factor out fw_cfg_add_acpi_dsdt() 2020-06-24 17:18:28 -04:00
intel_iommu.c intel_iommu: "aw-bits" error message still refers to "x-aw-bits" 2020-07-07 12:38:50 +02:00
intel_iommu_internal.h intel_iommu: add present bit check for pasid table entries 2020-01-06 12:04:51 -05:00
kvmvapic.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
microvm.c numa: Auto-enable NUMA when any memory devices are possible 2020-07-03 07:57:04 -04:00
multiboot.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
multiboot.h refer to FWCfgState explicitly 2013-06-02 18:14:02 +03:00
pc.c error: Avoid unnecessary error_propagate() after error_setg() 2020-07-10 15:18:08 +02:00
pc_piix.c qom: Put name parameter before value / visitor parameter 2020-07-10 15:18:08 +02:00
pc_q35.c qom: Put name parameter before value / visitor parameter 2020-07-10 15:18:08 +02:00
pc_sysfw.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
port92.c hw/i386/pc: Extract the port92 device 2019-12-17 19:33:51 +01:00
trace-events hw/i386/pc: Extract the port92 device 2019-12-17 19:33:51 +01:00
vmmouse.c hw/i386/vmport: Define enum for all commands 2020-06-10 12:09:46 -04:00
vmport.c hw/i386/vmport: Allow QTest use without crashing 2020-06-10 12:10:27 -04:00
x86-iommu-stub.c hw/i386/x86-iommu: Add missing stubs 2020-01-09 11:41:25 +00:00
x86-iommu.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
x86.c qom: Use returned bool to check for failure, Coccinelle part 2020-07-10 15:18:08 +02:00