#
62c9e416 |
| 19-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Switch transactions to JobTxn
This doesn't actually move any transaction code to Job yet, but it renames the type for transactions from BlockJobTxn to JobTxn and makes them contain Jobs rather
job: Switch transactions to JobTxn
This doesn't actually move any transaction code to Job yet, but it renames the type for transactions from BlockJobTxn to JobTxn and makes them contain Jobs rather than BlockJobs
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
6a74c075 |
| 20-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move job_finish_sync() to Job
block_job_finish_sync() doesn't contain anything block job specific any more, so it can be moved to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by:
job: Move job_finish_sync() to Job
block_job_finish_sync() doesn't contain anything block job specific any more, so it can be moved to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
3453d972 |
| 23-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move .complete callback to Job
This moves the .complete callback that tells a READY job to complete from BlockJobDriver to JobDriver. The wrapper function job_complete() doesn't require anythin
job: Move .complete callback to Job
This moves the .complete callback that tells a READY job to complete from BlockJobDriver to JobDriver. The wrapper function job_complete() doesn't require anything block job specific any more and can be moved to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
b69f777d |
| 20-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Add job_drain()
block_job_drain() contains a blk_drain() call which cannot be moved to Job, so add a new JobDriver callback JobDriver.drain which has a common implementation for all BlockJobs.
job: Add job_drain()
block_job_drain() contains a blk_drain() call which cannot be moved to Job, so add a new JobDriver callback JobDriver.drain which has a common implementation for all BlockJobs. In addition to this we keep the existing BlockJobDriver.drain callback that is called by the common drain implementation for all block jobs.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
004e95df |
| 20-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Convert block_job_cancel_async() to Job
block_job_cancel_async() did two things that were still block job specific:
* Setting job->force. This field makes sense on the Job level, so we can j
job: Convert block_job_cancel_async() to Job
block_job_cancel_async() did two things that were still block job specific:
* Setting job->force. This field makes sense on the Job level, so we can just move it. While at it, rename it to job->force_cancel to make its purpose more obvious.
* Resetting the I/O status. This can't be moved because generic Jobs don't have an I/O status. What the function really implements is a user resume, except without entering the coroutine. Consequently, it makes sense to call the .user_resume driver callback here which already resets the I/O status.
The old block_job_cancel_async() has two separate if statements that check job->iostatus != BLOCK_DEVICE_IO_STATUS_OK and job->user_paused. However, the former condition always implies the latter (as is asserted in block_job_iostatus_reset()), so changing the explicit call of block_job_iostatus_reset() on the former condition with the .user_resume callback on the latter condition is equivalent and doesn't need to access any BlockJob specific state.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
4ad35181 |
| 19-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move single job finalisation to Job
This moves the finalisation of a single job from BlockJob to Job.
Some part of this code depends on job transactions, and job transactions call this code, w
job: Move single job finalisation to Job
This moves the finalisation of a single job from BlockJob to Job.
Some part of this code depends on job transactions, and job transactions call this code, we introduce some temporary calls from Job functions to BlockJob ones. This will be fixed once transactions move to Job, too.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
139a9f02 |
| 23-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Add job_event_*()
Go through the Job layer in order to send QMP events. For the moment, these functions only call a notifier in the BlockJob layer that sends the existing commands.
This uses n
job: Add job_event_*()
Go through the Job layer in order to send QMP events. For the moment, these functions only call a notifier in the BlockJob layer that sends the existing commands.
This uses notifiers rather than JobDriver callbacks because internal users of jobs won't receive QMP events, but might still be interested in getting notified for the events.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
5d4f3769 |
| 23-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
blockjob: Split block_job_event_pending()
block_job_event_pending() doesn't only send a QMP event, but it also transitions to the PENDING state. Split the function so that we get one part only sendi
blockjob: Split block_job_event_pending()
block_job_event_pending() doesn't only send a QMP event, but it also transitions to the PENDING state. Split the function so that we get one part only sending the event (like other block_job_event_* functions) and another part that does the state transition.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
bb02b65c |
| 19-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move BlockJobCreateFlags to Job
This renames the BlockJobCreateFlags constants, moves a few JOB_INTERNAL checks to job_create() and the auto_{finalize,dismiss} fields from BlockJob to Job.
Sig
job: Move BlockJobCreateFlags to Job
This renames the BlockJobCreateFlags constants, moves a few JOB_INTERNAL checks to job_create() and the auto_{finalize,dismiss} fields from BlockJob to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
dbe5e6c1 |
| 19-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Replace BlockJob.completed with job_is_completed()
Since we introduced an explicit status to block job, BlockJob.completed is redundant because it can be derived from the status. Remove the fie
job: Replace BlockJob.completed with job_is_completed()
Since we introduced an explicit status to block job, BlockJob.completed is redundant because it can be derived from the status. Remove the field from BlockJob and add a function to derive it from the status at the Job level.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
b15de828 |
| 18-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move pause/resume functions to Job
While we already moved the state related to job pausing to Job, the functions to do were still BlockJob only. This commit moves them over to Job.
Signed-off-
job: Move pause/resume functions to Job
While we already moved the state related to job pausing to Job, the functions to do were still BlockJob only. This commit moves them over to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
5d43e86e |
| 18-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Add job_sleep_ns()
There is nothing block layer specific about block_job_sleep_ns(), so move the function to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: John Snow <jsnow@red
job: Add job_sleep_ns()
There is nothing block layer specific about block_job_sleep_ns(), so move the function to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
show more ...
|
#
da01ff7f |
| 13-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move coroutine and related code to Job
This commit moves some core functions for dealing with the job coroutine from BlockJob to Job. This includes primarily entering the coroutine (both for th
job: Move coroutine and related code to Job
This commit moves some core functions for dealing with the job coroutine from BlockJob to Job. This includes primarily entering the coroutine (both for the first and reentering) and yielding explicitly and at pause points.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
1908a559 |
| 17-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move defer_to_main_loop to Job
Move the defer_to_main_loop functionality from BlockJob to Job.
The code can be simplified because we can use job->aio_context in job_defer_to_main_loop_bh() now
job: Move defer_to_main_loop to Job
Move the defer_to_main_loop functionality from BlockJob to Job.
The code can be simplified because we can use job->aio_context in job_defer_to_main_loop_bh() now, instead of having to access the BlockDriverState.
Probably taking the data->aio_context lock in addition was already unnecessary in the old code because we didn't actually make use of anything protected by the old AioContext except getting the new AioContext, in case it changed between scheduling the BH and running it. But it's certainly unnecessary now that the BDS isn't accessed at all any more.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
08be6fe2 |
| 17-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Add Job.aio_context
When block jobs need an AioContext, they just take it from their main block node. Generic jobs don't have a main block node, so we need to assign them an AioContext explicit
job: Add Job.aio_context
When block jobs need an AioContext, they just take it from their main block node. Generic jobs don't have a main block node, so we need to assign them an AioContext explicitly.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
daa7f2f9 |
| 17-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move cancelled to Job
We cannot yet move the whole logic around job cancelling to Job because it depends on quite a few other things that are still only in BlockJob, but we can move the cancell
job: Move cancelled to Job
We cannot yet move the whole logic around job cancelling to Job because it depends on quite a few other things that are still only in BlockJob, but we can move the cancelled field at least.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
80fa2c75 |
| 13-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Add reference counting
This moves reference counting from BlockJob to Job.
In order to keep calling the BlockJob cleanup code when the job is deleted via job_unref(), introduce a new JobDriver
job: Add reference counting
This moves reference counting from BlockJob to Job.
In order to keep calling the BlockJob cleanup code when the job is deleted via job_unref(), introduce a new JobDriver.free callback. Every block job must use block_job_free() for this callback, this is asserted in block_job_create().
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
a50c2ab8 |
| 13-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Move state transitions to Job
This moves BlockJob.status and the closely related functions (block_)job_state_transition() and (block_)job_apply_verb to Job. The two QAPI enums are renamed to Jo
job: Move state transitions to Job
This moves BlockJob.status and the closely related functions (block_)job_state_transition() and (block_)job_apply_verb to Job. The two QAPI enums are renamed to JobStatus and JobVerb.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
#
e7c1d78b |
| 12-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Maintain a list of all jobs
This moves the job list from BlockJob to Job. Now we can check for duplicate IDs in job_create().
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reit
job: Maintain a list of all jobs
This moves the job list from BlockJob to Job. Now we can check for duplicate IDs in job_create().
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
fd61a701 |
| 12-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Add job_delete()
This moves freeing the Job object and its fields from block_job_unref() to job_delete().
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com
job: Add job_delete()
This moves freeing the Job object and its fields from block_job_unref() to job_delete().
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
252291ea |
| 12-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Add JobDriver.job_type
This moves the job_type field from BlockJobDriver to JobDriver.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John
job: Add JobDriver.job_type
This moves the job_type field from BlockJobDriver to JobDriver.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
8e4c8700 |
| 12-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Rename BlockJobType into JobType
QAPI types aren't externally visible, so we can rename them without causing problems. Before we add a job type to Job, rename the enum so it can be used for mor
job: Rename BlockJobType into JobType
QAPI types aren't externally visible, so we can rename them without causing problems. Before we add a job type to Job, rename the enum so it can be used for more than just block jobs.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
33e9e9bd |
| 12-Apr-2018 |
Kevin Wolf <kwolf@redhat.com> |
job: Create Job, JobDriver and job_create()
This is the first step towards creating an infrastructure for generic background jobs that aren't tied to a block device. For now, Job only stores its ID
job: Create Job, JobDriver and job_create()
This is the first step towards creating an infrastructure for generic background jobs that aren't tied to a block device. For now, Job only stores its ID and JobDriver, the rest stays in BlockJob.
The following patches will move over more parts of BlockJob to Job if they are meaningful outside the context of a block job.
BlockJob.driver is now redundant, but this patch leaves it around to avoid unnecessary churn. The next patches will get rid of almost all of its uses anyway so that it can be removed later with much less churn.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|
#
4c7e813c |
| 08-May-2018 |
Stefan Hajnoczi <stefanha@redhat.com> |
blockjob: do not cancel timer in resume
Currently the timer is cancelled and the block job is entered by block_job_resume(). This behavior causes drain to run extra blockjob iterations when the job
blockjob: do not cancel timer in resume
Currently the timer is cancelled and the block job is entered by block_job_resume(). This behavior causes drain to run extra blockjob iterations when the job was sleeping due to the ratelimit.
This patch leaves the job asleep when block_job_resume() is called. Jobs can still be forcibly woken up using block_job_enter(), which is used to cancel jobs.
After this patch drain no longer runs extra blockjob iterations. This is the expected behavior that qemu-iotests 185 used to rely on. We temporarily changed the 185 test output to make it pass for the QEMU 2.12 release but now it's time to address this issue.
Cc: QingFeng Hao <haoqf@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com> Message-id: 20180508135436.30140-3-stefanha@redhat.com Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com>
show more ...
|
Revision tags: v2.12.0-rc0, v2.11.1 |
|
#
bd21935b |
| 19-Jan-2018 |
Kevin Wolf <kwolf@redhat.com> |
blockjob: Add block_job_driver()
The backup block job directly accesses the driver field in BlockJob. Add a wrapper for getting it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Bl
blockjob: Add block_job_driver()
The backup block job directly accesses the driver field in BlockJob. Add a wrapper for getting it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
show more ...
|