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
..
2020-05-15 07:07:58 +02:00
2020-06-15 22:05:28 +02:00
2020-02-18 20:20:49 +01:00
2020-03-31 21:14:35 +08:00
2020-03-31 21:14:35 +08:00
2020-06-18 21:05:52 +08:00
2020-03-31 21:14:35 +08:00
2017-09-08 08:17:37 +08:00
2020-05-15 07:08:14 +02:00
2020-06-18 21:05:52 +08:00
2020-03-31 21:14:35 +08:00
2020-05-15 07:08:14 +02:00
2019-08-16 13:31:52 +02:00
2019-06-12 13:20:21 +02:00
2020-05-15 07:08:14 +02:00
2020-06-15 22:05:28 +02:00
2020-06-16 10:32:29 +01:00
2020-03-31 21:14:35 +08:00
2020-03-31 21:14:35 +08:00
2020-07-03 16:59:41 +01:00
2020-03-12 16:27:33 +00:00
2020-06-15 22:05:28 +02:00
2020-05-15 07:08:14 +02:00
2020-06-15 22:05:28 +02:00
2020-06-18 21:05:50 +08:00
2020-05-30 09:17:46 +02:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-04-30 11:52:28 +01:00
2020-05-15 07:07:58 +02:00
2020-05-15 07:08:14 +02:00
2019-08-16 13:31:53 +02:00
2019-08-16 13:31:52 +02:00
2020-03-03 18:04:47 +08:00
2020-03-03 18:04:47 +08:00
2018-03-02 18:44:00 +00:00
2020-03-31 21:14:35 +08:00
2020-05-15 07:08:14 +02:00
2019-08-16 13:31:53 +02:00
2020-01-07 17:24:29 +04:00
2020-05-15 07:08:14 +02:00
2020-06-15 22:05:28 +02:00
2020-06-15 22:00:10 +02:00
2020-01-24 20:59:15 +01:00
2020-05-15 07:08:14 +02:00
2020-05-15 07:08:14 +02:00
2020-07-03 16:59:41 +01:00
2020-06-18 21:05:51 +08:00
2020-06-18 21:05:51 +08:00
2020-07-03 07:57:04 -04:00
2020-07-07 07:59:51 -04:00
2020-07-10 15:17:35 +02:00
2017-11-20 11:08:00 +08:00
2019-06-12 13:20:21 +02:00
2020-05-15 07:08:14 +02:00
2017-11-20 11:08:00 +08:00
2016-07-12 16:20:46 +02:00
2019-08-16 13:31:52 +02:00
2020-01-24 20:59:15 +01:00
2020-07-02 06:25:29 +02:00
2020-03-31 21:14:35 +08:00