[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 03/14] block/block-backend: blk_iostatus_reset: drop
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 03/14] block/block-backend: blk_iostatus_reset: drop usage of bs->job |
Date: |
Tue, 18 Jun 2019 17:23:07 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
We are going to remove bs->job pointer. Drop it's usage in
blk_iostatus_reset.
blk_iostatus_reset() has only two callers:
1. blk_attach_dev(). This doesn't have anything to do with jobs and
attaching a new guest device won't solve any problem the job
encountered, so no reason to reset the iostatus for the job.
2. qmp_cont(). This resets the iostatus for everything. We can just
call block_job_iostatus_reset() for all block jobs instead of going
through BlockBackend.
Suggested-by: Kevin Wolf <address@hidden>
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/block-backend.c | 4 ----
monitor/qmp-cmds.c | 5 +++++
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index f5d9407d20..a8d160fd5d 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1073,11 +1073,7 @@ void blk_iostatus_disable(BlockBackend *blk)
void blk_iostatus_reset(BlockBackend *blk)
{
if (blk_iostatus_is_enabled(blk)) {
- BlockDriverState *bs = blk_bs(blk);
blk->iostatus = BLOCK_DEVICE_IO_STATUS_OK;
- if (bs && bs->job) {
- block_job_iostatus_reset(bs->job);
- }
}
}
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index f1b1e4f08b..01ce77e129 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -143,6 +143,7 @@ void qmp_x_exit_preconfig(Error **errp)
void qmp_cont(Error **errp)
{
BlockBackend *blk;
+ BlockJob *job;
Error *local_err = NULL;
/* if there is a dump in background, we should wait until the dump
@@ -166,6 +167,10 @@ void qmp_cont(Error **errp)
blk_iostatus_reset(blk);
}
+ for (job = block_job_next(NULL); job; job = block_job_next(job)) {
+ block_job_iostatus_reset(job);
+ }
+
/* Continuing after completed migration. Images have been inactivated to
* allow the destination to take control. Need to get control back now.
*
--
2.20.1
- [Qemu-block] [PULL 00/14] Block layer patches, Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 01/14] iotests: Hide timestamps for skipped tests, Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 03/14] block/block-backend: blk_iostatus_reset: drop usage of bs->job,
Kevin Wolf <=
- [Qemu-block] [PULL 02/14] block/replication: drop usage of bs->job, Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 09/14] block/commit: Drop bdrv_child_try_set_perm(), Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 08/14] block/mirror: Fix child permissions, Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 05/14] block: drop bs->job, Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 06/14] file-posix: Update open_flags in raw_set_perm(), Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 07/14] block: Add bdrv_child_refresh_perms(), Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 11/14] block: Add *tighten_restrictions to *check*_perm(), Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 04/14] blockdev: blockdev_mark_auto_del: drop usage of bs->job, Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 13/14] iotests: Test failure to loosen restrictions, Kevin Wolf, 2019/06/18
- [Qemu-block] [PULL 12/14] block: Ignore loosening perm restrictions failures, Kevin Wolf, 2019/06/18