Use &error_abort instead of separate assert()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200313170517.22480-2-armbru@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
[Unused Error *variable deleted]
This commit is contained in:
Markus Armbruster 2020-03-13 18:05:15 +01:00
parent 40c67636f6
commit 20ac582d0c
3 changed files with 5 additions and 14 deletions

View File

@ -838,10 +838,8 @@ void hmp_info_blockstats(Monitor *mon, const QDict *qdict)
void hmp_info_block_jobs(Monitor *mon, const QDict *qdict)
{
BlockJobInfoList *list;
Error *err = NULL;
list = qmp_query_block_jobs(&err);
assert(!err);
list = qmp_query_block_jobs(&error_abort);
if (!list) {
monitor_printf(mon, "No active jobs\n");

View File

@ -206,9 +206,7 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
return NULL;
}
} else {
Error *err = NULL;
arm_cpu_finalize_features(ARM_CPU(obj), &err);
assert(err == NULL);
arm_cpu_finalize_features(ARM_CPU(obj), &error_abort);
}
expansion_info = g_new0(CpuModelExpansionInfo, 1);
@ -221,12 +219,10 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
while ((name = cpu_model_advertised_features[i++]) != NULL) {
ObjectProperty *prop = object_property_find(obj, name, NULL);
if (prop) {
Error *err = NULL;
QObject *value;
assert(prop->get);
value = object_property_get_qobject(obj, name, &err);
assert(!err);
value = object_property_get_qobject(obj, name, &error_abort);
qdict_put_obj(qdict_out, name, value);
}

View File

@ -55,10 +55,8 @@ static void qos_set_machines_devices_available(void)
QObject *response;
QDict *args = qdict_new();
QList *lst;
Error *err = NULL;
qmp_marshal_query_machines(NULL, &response, &err);
assert(!err);
qmp_marshal_query_machines(NULL, &response, &error_abort);
lst = qobject_to(QList, response);
apply_to_qlist(lst, true);
@ -70,8 +68,7 @@ static void qos_set_machines_devices_available(void)
qdict_put_bool(args, "abstract", true);
qdict_put_obj(req, "arguments", (QObject *) args);
qmp_marshal_qom_list_types(args, &response, &err);
assert(!err);
qmp_marshal_qom_list_types(args, &response, &error_abort);
lst = qobject_to(QList, response);
apply_to_qlist(lst, false);
qobject_unref(response);