mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00
error, qerror: pass desc string to error calls
This commit changes all QERR_ macros to contain a human message (ie. the desc string found in qerr_table[]) instead of a json dictionary in string format. Before this commit, error_set() and qerror_report() would receive a json dictionary in string format and build a qobject from it. Now, both function receive a human message instead and the qobject is not built anymore. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
7795b166d9
commit
df1e608a01
4 changed files with 77 additions and 119 deletions
3
error.c
3
error.c
|
@ -37,9 +37,8 @@ void error_set(Error **errp, ErrorClass err_class, const char *fmt, ...)
|
|||
err = g_malloc0(sizeof(*err));
|
||||
|
||||
va_start(ap, fmt);
|
||||
err->obj = qobject_to_qdict(qobject_from_jsonv(fmt, &ap));
|
||||
err->msg = g_strdup_vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
err->msg = qerror_format(fmt, err->obj);
|
||||
err->err_class = err_class;
|
||||
|
||||
*errp = err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue