summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/job.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 8c8badf75e..1d820530fa 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -124,6 +124,9 @@ typedef struct Job {
/** Estimated progress_current value at the completion of the job */
int64_t progress_total;
+ /** Error string for a failed job (NULL if, and only if, job->ret == 0) */
+ char *error;
+
/** ret code passed to job_completed. */
int ret;
@@ -466,13 +469,15 @@ void job_transition_to_ready(Job *job);
/**
* @job: The job being completed.
* @ret: The status code.
+ * @error: The error message for a failing job (only with @ret < 0). If @ret is
+ * negative, but NULL is given for @error, strerror() is used.
*
* Marks @job as completed. If @ret is non-zero, the job transaction it is part
* of is aborted. If @ret is zero, the job moves into the WAITING state. If it
* is the last job to complete in its transaction, all jobs in the transaction
* move from WAITING to PENDING.
*/
-void job_completed(Job *job, int ret);
+void job_completed(Job *job, int ret, Error *error);
/** Asynchronously complete the specified @job. */
void job_complete(Job *job, Error **errp);