Skip to content

Commit

Permalink
blockjob: Remove BlockJob.bs
Browse files Browse the repository at this point in the history
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 <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
  • Loading branch information
kevmw committed May 25, 2016
1 parent 4653456 commit b75536c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion blockjob.c
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion include/block/blockjob.h
Expand Up @@ -82,7 +82,6 @@ struct BlockJob {
const BlockJobDriver *driver;

/** The block device on which the job is operating. */
BlockDriverState *bs; /* TODO Remove */
BlockBackend *blk;

/**
Expand Down
2 changes: 1 addition & 1 deletion qemu-img.c
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion tests/test-blockjob-txn.c
Expand Up @@ -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;
Expand All @@ -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)) {
Expand Down

0 comments on commit b75536c

Please sign in to comment.