[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 32/35] job: Add job_progress_increase_remaining()
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 32/35] job: Add job_progress_increase_remaining() |
Date: |
Mon, 18 Jun 2018 18:45:01 +0200 |
From: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
include/qemu/job.h | 15 +++++++++++++++
job.c | 5 +++++
2 files changed, 20 insertions(+)
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 1d820530fa..18c9223e31 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -335,6 +335,21 @@ void job_progress_update(Job *job, uint64_t done);
*/
void job_progress_set_remaining(Job *job, uint64_t remaining);
+/**
+ * @job: The job whose expected progress end value is updated
+ * @delta: Value which is to be added to the current expected end
+ * value
+ *
+ * Increases the expected end value of the progress counter of a job.
+ * This is useful for parenthesis operations: If a job has to
+ * conditionally perform a high-priority operation as part of its
+ * progress, it calls this function with the expected operation's
+ * length before, and job_progress_update() afterwards.
+ * (So the operation acts as a parenthesis in regards to the main job
+ * operation running in background.)
+ */
+void job_progress_increase_remaining(Job *job, uint64_t delta);
+
/** To be called when a cancelled job is finalised. */
void job_event_cancelled(Job *job);
diff --git a/job.c b/job.c
index 84e140238b..fa671b431a 100644
--- a/job.c
+++ b/job.c
@@ -385,6 +385,11 @@ void job_progress_set_remaining(Job *job, uint64_t
remaining)
job->progress_total = job->progress_current + remaining;
}
+void job_progress_increase_remaining(Job *job, uint64_t delta)
+{
+ job->progress_total += delta;
+}
+
void job_event_cancelled(Job *job)
{
notifier_list_notify(&job->on_finalize_cancelled, job);
--
2.13.6
- [Qemu-block] [PULL 21/35] block: fix QEMU crash with scsi-hd and drive_del, (continued)
- [Qemu-block] [PULL 21/35] block: fix QEMU crash with scsi-hd and drive_del, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 18/35] block: ignore_bds_parents parameter for drain functions, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 23/35] block/mirror: Convert to coroutines, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 24/35] block/mirror: Use CoQueue to wait on in-flight ops, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 25/35] block/mirror: Wait for in-flight op conflicts, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 20/35] test-bdrv-drain: Test graph changes in drain_all section, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 22/35] block/mirror: Pull out mirror_perform(), Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 27/35] block: Generalize should_update_child() rule, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 26/35] block/mirror: Use source as a BdrvChild, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 28/35] hbitmap: Add @advance param to hbitmap_iter_next(), Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 32/35] job: Add job_progress_increase_remaining(),
Kevin Wolf <=
- [Qemu-block] [PULL 30/35] block/dirty-bitmap: Add bdrv_dirty_iter_next_area, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 29/35] test-hbitmap: Add non-advancing iter_next tests, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 31/35] block/mirror: Add MirrorBDSOpaque, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 35/35] iotests: Add test for active mirroring, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 34/35] block/mirror: Add copy mode QAPI interface, Kevin Wolf, 2018/06/18
- [Qemu-block] [PULL 33/35] block/mirror: Add active mirroring, Kevin Wolf, 2018/06/18
- Re: [Qemu-block] [Qemu-devel] [PULL 00/35] Block layer patches, no-reply, 2018/06/18
- Re: [Qemu-block] [Qemu-devel] [PULL 00/35] Block layer patches, Peter Maydell, 2018/06/19