qemu-e2k/chardev
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
..
baum.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
char-console.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-fd.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
char-fe.c char: update the mux handlers in class callback 2019-02-13 15:36:14 +01:00
char-file.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-io.c chardev: use a child source for qio input source 2018-10-03 14:45:05 +04:00
char-mux.c chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
char-null.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-parallel.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-pipe.c chardev: Improve error report by calling error_setg_win32() 2020-03-09 13:36:15 +01:00
char-pty.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
char-ringbuf.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-serial.c chardev: Add macOS to list of OSes that support -chardev serial 2020-05-04 14:35:23 +02:00
char-socket.c Clean up some calls to ignore Error objects the right way 2020-07-02 06:25:28 +02:00
char-stdio.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-udp.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
char-win-stdio.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
char-win.c chardev: Improve error report by calling error_setg_win32() 2020-03-09 13:36:15 +01:00
char.c qemu-option: Use returned bool to check for failure 2020-07-10 15:17:35 +02:00
Makefile.objs chardev: enable modules, use for braille 2020-07-07 15:33:59 +02:00
msmouse.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
spice.c qemu/queue.h: add QLIST_SAFE_REMOVE() 2020-02-22 08:26:47 +00:00
testdev.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
wctablet.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00