]> git.proxmox.com Git - mirror_qemu.git/commit
job: Add error message for failing jobs
authorKevin Wolf <kwolf@redhat.com>
Thu, 24 May 2018 13:26:10 +0000 (15:26 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 30 May 2018 11:31:01 +0000 (13:31 +0200)
commit1266c9b9f5fa05877b979eece5963a2bd99c3bfd
tree348fa8501283cccf4a62ace8e262ca6bef6c1939
parent4a5f2779bad769184550869931937acd0707ec3b
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>
block/backup.c
block/commit.c
block/mirror.c
block/stream.c
include/qemu/job.h
job-qmp.c
job.c
tests/test-bdrv-drain.c
tests/test-blockjob-txn.c
tests/test-blockjob.c