diff options
author | John Snow <jsnow@redhat.com> | 2018-05-08 19:36:59 -0400 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-15 16:11:41 +0200 |
commit | ab9ba614556ac5b0f8d96b99e0dba19f1e28d6c2 (patch) | |
tree | ff48df612fd9cfa876f9b88038208a295012c0e3 /blockjob.c | |
parent | 83592184d8692c818e083c3ce43f63ca2533fa85 (diff) | |
download | qemu-ab9ba614556ac5b0f8d96b99e0dba19f1e28d6c2.zip qemu-ab9ba614556ac5b0f8d96b99e0dba19f1e28d6c2.tar.gz qemu-ab9ba614556ac5b0f8d96b99e0dba19f1e28d6c2.tar.bz2 |
blockjob: expose error string via query
When we've reached the concluded state, we need to expose the error
state if applicable. Add the new field.
This should be sufficient for determining if a job completed
successfully or not after concluding; if we want to discriminate
based on how it failed more mechanically, we can always add an
explicit return code enumeration later.
I didn't bother to make it only show up if we are in the concluded
state; I don't think it's necessary.
Cc: qemu-stable@nongnu.org
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockjob.c')
-rw-r--r-- | blockjob.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -831,6 +831,8 @@ BlockJobInfo *block_job_query(BlockJob *job, Error **errp) info->status = job->status; info->auto_finalize = job->auto_finalize; info->auto_dismiss = job->auto_dismiss; + info->has_error = job->ret != 0; + info->error = job->ret ? g_strdup(strerror(-job->ret)) : NULL; return info; } |