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]>
job->driver = driver;
job->id = g_strdup(bdrv_get_device_name(bs));
- job->bs = bs;
job->blk = blk;
job->cb = cb;
job->opaque = opaque;
const BlockJobDriver *driver;
/** The block device on which the job is operating. */
- BlockDriverState *bs; /* TODO Remove */
BlockBackend *blk;
/**
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);
#include "qapi/error.h"
#include "qemu/main-loop.h"
#include "block/blockjob.h"
+#include "sysemu/block-backend.h"
typedef struct {
BlockJob common;
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)) {