]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
block/block-backend: blk_iostatus_reset: drop usage of bs->job
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 6 Jun 2019 15:41:30 +0000 (18:41 +0300)
committerKevin Wolf <kwolf@redhat.com>
Tue, 18 Jun 2019 14:41:10 +0000 (16:41 +0200)
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>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/block-backend.c
monitor/qmp-cmds.c

index f5d9407d204f9f5fbc22c1e01bfbf161ea17e65c..a8d160fd5d723f8e4e85f9c8eea662289a0f831e 100644 (file)
@@ -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);
-        }
     }
 }
 
index f1b1e4f08b760275783c1d63e2d8e80a1f953912..01ce77e12923a31ccb5f67d09b7067ddeaeb7a8d 100644 (file)
@@ -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.
      *