From 1266c9b9f5fa05877b979eece5963a2bd99c3bfd Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 24 May 2018 15:26:10 +0200 Subject: 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 Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- tests/test-bdrv-drain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test-bdrv-drain.c') diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 2cba63b881..a11c4cfbf2 100644 --- a/tests/test-bdrv-drain.c +++ b/tests/test-bdrv-drain.c @@ -498,7 +498,7 @@ typedef struct TestBlockJob { static void test_job_completed(Job *job, void *opaque) { - job_completed(job, 0); + job_completed(job, 0, NULL); } static void coroutine_fn test_job_start(void *opaque) -- cgit v1.2.3-55-g7522