diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-05-24 15:26:10 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-30 13:31:01 +0200 |
commit | 1266c9b9f5fa05877b979eece5963a2bd99c3bfd (patch) | |
tree | 348fa8501283cccf4a62ace8e262ca6bef6c1939 /block/mirror.c | |
parent | 4a5f2779bad769184550869931937acd0707ec3b (diff) |
job: Add error message for failing jobs
So far we relied on job->ret and strerror() to produce an error message
for failed jobs. Not surprisingly, this tends to result in completely
useless messages.
This adds a Job.error field that can contain an error string for a
failing job, and a parameter to job_completed() that sets the field. As
a default, if NULL is passed, we continue to use strerror(job->ret).
All existing callers are changed to pass NULL. They can be improved in
separate patches.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/mirror.c b/block/mirror.c index dcb66ec3be..435268bbbf 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -581,7 +581,7 @@ static void mirror_exit(Job *job, void *opaque) blk_set_perm(bjob->blk, 0, BLK_PERM_ALL, &error_abort); blk_insert_bs(bjob->blk, mirror_top_bs, &error_abort); - job_completed(job, data->ret); + job_completed(job, data->ret, NULL); g_free(data); bdrv_drained_end(src); |