]> Git Repo - qemu.git/commitdiff
blockjob: Remove BlockJob.bs
authorKevin Wolf <[email protected]>
Mon, 18 Apr 2016 15:30:17 +0000 (17:30 +0200)
committerKevin Wolf <[email protected]>
Wed, 25 May 2016 17:04:21 +0000 (19:04 +0200)
There is a single remaining user in qemu-img, and another one in a test
case, both of which can be trivially converted to using BlockJob.blk
instead.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
blockjob.c
include/block/blockjob.h
qemu-img.c
tests/test-blockjob-txn.c

index 2097e1d0946c1a3aa778286706cd1d833290f471..c095cc57cbf842a7c0da1809abd7554e4c813539 100644 (file)
@@ -83,7 +83,6 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
 
     job->driver        = driver;
     job->id            = g_strdup(bdrv_get_device_name(bs));
-    job->bs            = bs;
     job->blk           = blk;
     job->cb            = cb;
     job->opaque        = opaque;
index 32012afb2c0a1a60441168e1c1b3ecb0c9c38758..86d28070b8fc7c651f3a95bf1bc0d78589069a81 100644 (file)
@@ -82,7 +82,6 @@ struct BlockJob {
     const BlockJobDriver *driver;
 
     /** The block device on which the job is operating.  */
-    BlockDriverState *bs; /* TODO Remove */
     BlockBackend *blk;
 
     /**
index 206534824825afe232de4128ef1dd1b8d08af360..4b56ad36aa5e65069290bfb8720968449f13fb29 100644 (file)
@@ -775,7 +775,7 @@ static void common_block_job_cb(void *opaque, int ret)
 
 static void run_block_job(BlockJob *job, Error **errp)
 {
-    AioContext *aio_context = bdrv_get_aio_context(job->bs);
+    AioContext *aio_context = blk_get_aio_context(job->blk);
 
     do {
         aio_poll(aio_context, true);
index 55fad9507ad6cbadd3d5e024eaf0415a460fb4f0..828389bb454d65106f9f44fbedabccd78be787a8 100644 (file)
@@ -15,6 +15,7 @@
 #include "qapi/error.h"
 #include "qemu/main-loop.h"
 #include "block/blockjob.h"
+#include "sysemu/block-backend.h"
 
 typedef struct {
     BlockJob common;
@@ -30,7 +31,7 @@ static const BlockJobDriver test_block_job_driver = {
 
 static void test_block_job_complete(BlockJob *job, void *opaque)
 {
-    BlockDriverState *bs = job->bs;
+    BlockDriverState *bs = blk_bs(job->blk);
     int rc = (intptr_t)opaque;
 
     if (block_job_is_cancelled(job)) {
This page took 0.032828 seconds and 4 git commands to generate.