qemu-e2k/backends
Markus Armbruster 62a35aaa31 qapi: Use returned bool to check for failure, Coccinelle part
The previous commit enables conversion of

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

to

    if (!visit_foo(..., errp)) {
        ...
    }

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

    @@
    identifier fun =~ "check_list|input_type_enum|lv_start_struct|lv_type_bool|lv_type_int64|lv_type_str|lv_type_uint64|output_type_enum|parse_type_bool|parse_type_int64|parse_type_null|parse_type_number|parse_type_size|parse_type_str|parse_type_uint64|print_type_bool|print_type_int64|print_type_null|print_type_number|print_type_size|print_type_str|print_type_uint64|qapi_clone_start_alternate|qapi_clone_start_list|qapi_clone_start_struct|qapi_clone_type_bool|qapi_clone_type_int64|qapi_clone_type_null|qapi_clone_type_number|qapi_clone_type_str|qapi_clone_type_uint64|qapi_dealloc_start_list|qapi_dealloc_start_struct|qapi_dealloc_type_anything|qapi_dealloc_type_bool|qapi_dealloc_type_int64|qapi_dealloc_type_null|qapi_dealloc_type_number|qapi_dealloc_type_str|qapi_dealloc_type_uint64|qobject_input_check_list|qobject_input_check_struct|qobject_input_start_alternate|qobject_input_start_list|qobject_input_start_struct|qobject_input_type_any|qobject_input_type_bool|qobject_input_type_bool_keyval|qobject_input_type_int64|qobject_input_type_int64_keyval|qobject_input_type_null|qobject_input_type_number|qobject_input_type_number_keyval|qobject_input_type_size_keyval|qobject_input_type_str|qobject_input_type_str_keyval|qobject_input_type_uint64|qobject_input_type_uint64_keyval|qobject_output_start_list|qobject_output_start_struct|qobject_output_type_any|qobject_output_type_bool|qobject_output_type_int64|qobject_output_type_null|qobject_output_type_number|qobject_output_type_str|qobject_output_type_uint64|start_list|visit_check_list|visit_check_struct|visit_start_alternate|visit_start_list|visit_start_struct|visit_type_.*";
    expression list args;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err);
    -    if (err)
    +    if (!fun(args, &err))
         {
             ...
         }

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-19-armbru@redhat.com>
2020-07-10 15:18:08 +02:00
..
tpm qapi: Use returned bool to check for failure, Coccinelle part 2020-07-10 15:18:08 +02:00
cryptodev-builtin.c cryptodev: Fix cryptodev_builtin_cleanup() error API violation 2020-04-29 08:01:52 +02:00
cryptodev-vhost-user.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cryptodev-vhost.c cryptodev: add vhost support 2018-03-01 18:26:17 +02:00
cryptodev.c qapi: Use returned bool to check for failure, Coccinelle part 2020-07-10 15:18:08 +02:00
dbus-vmstate.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
hostmem-file.c qapi: Use returned bool to check for failure, Coccinelle part 2020-07-10 15:18:08 +02:00
hostmem-memfd.c qapi: Use returned bool to check for failure, Coccinelle part 2020-07-10 15:18:08 +02:00
hostmem-ram.c machine: alias -mem-path and -mem-prealloc into memory-foo backend 2020-02-19 16:49:53 +00:00
hostmem.c qapi: Use returned bool to check for failure, Coccinelle part 2020-07-10 15:18:08 +02:00
Kconfig tpm: Move backend code under the 'backends/' directory 2020-06-19 07:25:55 -04:00
Makefile.objs backends: Add TPM files into their own directory 2020-06-19 07:24:42 -04:00
rng-builtin.c virtio-rng: change default backend to rng-builtin 2019-09-04 06:32:51 -04:00
rng-egd.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
rng-random.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
rng.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
trace-events Add dbus-vmstate object 2020-01-06 18:41:32 +04:00
vhost-user.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00