mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
qapi: Use returned bool to check for failure (again)
Commit012d4c96e2changed the visitor functions taking Error ** to return bool instead of void, and the commits following it used the new return value to simplify error checking. Since then a few more uses in need of the same treatment crept in. Do that. All pretty mechanical except for * balloon_stats_get_all() This is basically the same transformation commit012d4c96e2applied to the virtual walk example in include/qapi/visitor.h. * set_max_queue_size() Additionally replace "goto end of function" by return. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20221121085054.683122-10-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
@@ -679,14 +679,11 @@ static void set_reserved_region(Object *obj, Visitor *v, const char *name,
|
||||
{
|
||||
Property *prop = opaque;
|
||||
ReservedRegion *rr = object_field_prop_ptr(obj, prop);
|
||||
Error *local_err = NULL;
|
||||
const char *endptr;
|
||||
char *str;
|
||||
int ret;
|
||||
|
||||
visit_type_str(v, name, &str, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!visit_type_str(v, name, &str, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user