From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: kwolf@redhat.com, vsementsov@virtuozzo.com,
wencongyang2@huawei.com, xiechanglong.d@gmail.com,
armbru@redhat.com, mreitz@redhat.com, den@openvz.org,
jsnow@redhat.com
Subject: [Qemu-devel] [PATCH 2/4] block/block-backend: blk_iostatus_reset: drop usage of bs->job
Date: Thu, 6 Jun 2019 18:41:30 +0300 [thread overview]
Message-ID: <20190606154132.153330-3-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20190606154132.153330-1-vsementsov@virtuozzo.com>
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 <kwolf@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block/block-backend.c | 4 ----
qmp.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/qmp.c b/qmp.c
index fa1b3c1577..89cf10e28e 100644
--- a/qmp.c
+++ b/qmp.c
@@ -142,6 +142,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
@@ -165,6 +166,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.18.0
next prev parent reply other threads:[~2019-06-06 15:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 15:41 [Qemu-devel] [PATCH 0/4] block: drop bs->job Vladimir Sementsov-Ogievskiy
2019-06-06 15:41 ` [Qemu-devel] [PATCH 1/4] block/replication: drop usage of bs->job Vladimir Sementsov-Ogievskiy
2019-06-06 15:41 ` Vladimir Sementsov-Ogievskiy [this message]
2019-06-06 15:41 ` [Qemu-devel] [PATCH 3/4] blockdev: blockdev_mark_auto_del: " Vladimir Sementsov-Ogievskiy
2019-06-06 15:41 ` [Qemu-devel] [PATCH 4/4] block: drop bs->job Vladimir Sementsov-Ogievskiy
2019-06-17 16:58 ` Kevin Wolf
2019-06-18 6:53 ` Vladimir Sementsov-Ogievskiy
2019-06-06 16:37 ` [Qemu-devel] [PATCH 0/4] " no-reply
2019-06-14 10:17 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190606154132.153330-3-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wencongyang2@huawei.com \
--cc=xiechanglong.d@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).