History | View | Annotate | Download (7.6 kB)
Use error_is_set() only when necessary
error_is_set(&var) is the same as var != NULL, but it takeswhole-program analysis to figure that out. Unnecessarily hard foroptimizers, static checkers, and human readers. Dumb it down toobvious.
Gets rid of several dozen Coverity false positives....
blockjob: rename BlockJobType to BlockJobDriver
We will use BlockJobType as the enum type name of block jobs in QAPI,rename current BlockJobType to BlockJobDriver, which will eventuallybecome a set of operations, similar to block drivers.
Signed-off-by: Fam Zheng <famz@redhat.com>...
qapi: make use of new BlockJobType
Switch the string to enum type BlockJobType in BlockJobDriver.
Signed-off-by: Fam Zheng <famz@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: use BDS ref for block jobs
Block jobs used drive_get_ref(drive_get_by_blockdev(bs)) to avoid BDSbeing deleted. Now we have BDS reference count, and block jobs don'tcare about dinfo, so replace them to get cleaner code. It is also thesafe way when BDS has no drive info....
aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API
Convert block_job_sleep_ns and co_sleep_ns to use the new timerAPI.
Signed-off-by: Alex Bligh <alex@alex.org.uk>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
monitor: move include files to include/monitor/
qapi: move include files to include/qobject/
block: move include files to include/block/
iostatus: forward block_job_iostatus_reset to block job
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: rename block_job_complete to block_job_completed
The imperative will be used for the QMP command.
block: add block-job-complete
While streaming can be dropped as soon as it progressed through the wholeimage, mirroring needs to be completed manually for two reasons: 1) so thatmanagement knows exactly when the VM switches to the target; 2) becausefor other use cases such as replication, we may leave the operation running...
block: introduce BLOCK_JOB_READY event
Even for jobs that need to be manually completed, management may wantto take care itself of the completion, not requiring the user to issuea command to terminate the job. In this case we want to avoid thatthey poll us continuously, waiting for completion to become available....
block: introduce block job error
The following behaviors are possible:
'report': The behavior is the same as in 1.1. An I/O error,respectively during a read or a write, will complete the job immediatelywith an error code.
'ignore': An I/O error, respectively during a read or a write, will be...
block: add block_job_query
Extract it out of the implementation of info block-jobs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qmp: add 'busy' member to BlockJobInfo
Because pausing a job is asynchronous, we need to know whether it hascompleted. This is described by the "busy" field of BlockJob; copy itto BlockJobInfo.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
block: add support for job pause/resume
Job pausing reuses the existing support for cancellable sleeps. A pausehappens at the next sleeping point and lasts until the coroutine isre-entered explicitly. Cancellation was already doing a forced resume,so implement it explicitly in terms of resume....
block: move job APIs to separate files