qemu-patch-raspberry4/hw/smbios
Markus Armbruster 235e59cf03 qemu-option: Use returned bool to check for failure
The previous commit enables conversion of

    foo(..., &err);
    if (err) {
        ...
    }

to

    if (!foo(..., &err)) {
        ...
    }

for QemuOpts functions that now return true / false on success /
error.  Coccinelle script:

    @@
    identifier fun = {
        opts_do_parse, parse_option_bool, parse_option_number,
        parse_option_size, qemu_opt_parse, qemu_opt_rename, qemu_opt_set,
        qemu_opt_set_bool, qemu_opt_set_number, qemu_opts_absorb_qdict,
        qemu_opts_do_parse, qemu_opts_from_qdict_entry, qemu_opts_set,
        qemu_opts_validate
    };
    expression list args, args2;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err, args2);
    -    if (err)
    +    if (!fun(args, &err, args2))
         {
             ...
         }

A few line breaks tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-15-armbru@redhat.com>
[Conflict with commit 0b6786a9c1 "block/amend: refactor qcow2 amend
options" resolved by rerunning Coccinelle on master's version]
2020-07-10 15:17:35 +02:00
..
Kconfig kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
Makefile.objs stubs: move smbios stubs to hw/smbios 2017-01-16 17:52:35 +01:00
smbios-stub.c hw/smbios: Move to the hw/firmware/ subdirectory 2018-12-19 16:48:16 -05:00
smbios.c qemu-option: Use returned bool to check for failure 2020-07-10 15:17:35 +02:00
smbios_build.h hw/smbios: Remove "smbios_ipmi.h" 2018-12-19 16:48:16 -05:00
smbios_type_38-stub.c hw/smbios: Remove "smbios_ipmi.h" 2018-12-19 16:48:16 -05:00
smbios_type_38.c smbios:ipmi: Ignore IPMI devices with no fwinfo function 2019-09-20 14:08:10 -05:00