mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
44c7ca5ebf
commit
3bd293c3fd
3
block.c
3
block.c
|
@ -4369,6 +4369,9 @@ void bdrv_iostatus_reset(BlockDriverState *bs)
|
||||||
{
|
{
|
||||||
if (bdrv_iostatus_is_enabled(bs)) {
|
if (bdrv_iostatus_is_enabled(bs)) {
|
||||||
bs->iostatus = BLOCK_DEVICE_IO_STATUS_OK;
|
bs->iostatus = BLOCK_DEVICE_IO_STATUS_OK;
|
||||||
|
if (bs->job) {
|
||||||
|
block_job_iostatus_reset(bs->job);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,9 @@ bool block_job_is_cancelled(BlockJob *job)
|
||||||
void block_job_iostatus_reset(BlockJob *job)
|
void block_job_iostatus_reset(BlockJob *job)
|
||||||
{
|
{
|
||||||
job->iostatus = BLOCK_DEVICE_IO_STATUS_OK;
|
job->iostatus = BLOCK_DEVICE_IO_STATUS_OK;
|
||||||
|
if (job->job_type->iostatus_reset) {
|
||||||
|
job->job_type->iostatus_reset(job);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct BlockCancelData {
|
struct BlockCancelData {
|
||||||
|
|
|
@ -42,6 +42,9 @@ typedef struct BlockJobType {
|
||||||
/** Optional callback for job types that support setting a speed limit */
|
/** Optional callback for job types that support setting a speed limit */
|
||||||
void (*set_speed)(BlockJob *job, int64_t speed, Error **errp);
|
void (*set_speed)(BlockJob *job, int64_t speed, Error **errp);
|
||||||
|
|
||||||
|
/** Optional callback for job types that need to forward I/O status reset */
|
||||||
|
void (*iostatus_reset)(BlockJob *job);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional callback for job types whose completion must be triggered
|
* Optional callback for job types whose completion must be triggered
|
||||||
* manually.
|
* manually.
|
||||||
|
@ -253,7 +256,8 @@ int block_job_cancel_sync(BlockJob *job);
|
||||||
* block_job_iostatus_reset:
|
* block_job_iostatus_reset:
|
||||||
* @job: The job whose I/O status should be reset.
|
* @job: The job whose I/O status should be reset.
|
||||||
*
|
*
|
||||||
* Reset I/O status on @job.
|
* Reset I/O status on @job and on BlockDriverState objects it uses,
|
||||||
|
* other than job->bs.
|
||||||
*/
|
*/
|
||||||
void block_job_iostatus_reset(BlockJob *job);
|
void block_job_iostatus_reset(BlockJob *job);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue