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-18 18:16:00 +01:00
2020-03-09 16:45:16 +00:00
2018-09-25 15:50:15 +02:00
2020-05-18 18:16:00 +01:00
2020-05-18 18:16:00 +01:00
2018-10-02 18:47:55 +02:00
2019-07-15 15:39:02 +02:00
2019-01-11 15:46:56 +01:00
2020-04-01 14:24:03 -04:00
2020-01-21 14:18:12 -10:00
2019-06-12 13:20:20 +02:00
2020-06-23 15:46:05 +01:00
2020-06-23 15:46:05 +01:00
2019-06-12 13:20:20 +02:00
2019-12-18 12:26:25 +01:00
2020-01-06 18:41:32 +04:00
2019-06-12 13:20:20 +02:00
2019-12-18 08:36:16 +01:00
2019-10-24 19:26:52 +02:00
2020-03-09 16:41:31 +00:00
2020-05-18 18:16:00 +01:00
2020-03-09 16:41:31 +00:00
2019-08-16 13:31:52 +02:00
2019-04-02 13:52:02 +01:00
2019-04-02 13:52:02 +01:00
2020-06-26 06:45:29 -04:00
2020-01-07 12:08:39 +01:00
2020-03-18 14:03:46 -04:00
2020-01-07 16:50:09 +04:00
2019-10-08 14:27:35 +01:00
2020-05-04 16:07:43 +01:00
2019-10-22 09:38:42 +02:00
2020-06-05 21:23:22 +02:00
2019-09-11 08:46:17 +02:00
2019-10-26 15:38:06 +02:00
2020-07-07 15:33:59 +02:00
2019-09-24 12:18:47 +01:00
2020-02-21 09:15:03 +11:00
2020-03-09 13:36:15 +01:00
2020-06-23 11:39:46 +01:00
2019-10-26 15:38:06 +02:00
2019-06-24 22:19:30 +02:00
2019-10-28 11:22:31 +01:00
2020-07-10 15:17:35 +02:00
2019-10-25 14:38:29 +02:00
2019-06-12 13:20:20 +02:00
2019-11-18 16:01:34 -06:00
2019-06-12 13:20:20 +02:00
2019-12-18 08:36:15 +01:00
2020-07-06 07:37:02 +02:00
2020-07-10 15:17:35 +02:00
2019-04-18 22:18:59 +02:00
2020-05-20 10:34:40 +01:00
2018-12-20 10:29:08 +01:00
2020-06-16 14:49:05 +01:00
2019-09-16 17:13:06 +02:00
2020-02-12 16:23:01 +01:00
2020-06-26 06:45:30 -04:00
2020-06-16 14:49:05 +01:00
2019-12-17 19:33:52 +01:00
2019-01-30 10:51:20 +01:00
2020-05-04 16:07:43 +01:00
2019-06-11 20:22:09 +02:00
2020-04-07 16:19:49 +01:00
2020-05-04 14:54:35 -05:00
2020-05-04 16:07:43 +01:00
2020-03-09 16:45:16 +00:00
2019-06-12 13:20:20 +02:00
2020-05-04 16:07:43 +01:00