From patchwork Wed May 25 12:29:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 626168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rFBqj0pLgz9sdQ for ; Wed, 25 May 2016 22:46:57 +1000 (AEST) Received: from localhost ([::1]:59649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5YD8-0007yN-UJ for incoming@patchwork.ozlabs.org; Wed, 25 May 2016 08:46:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Xwy-0000k1-VF for qemu-devel@nongnu.org; Wed, 25 May 2016 08:30:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Xwt-0000zs-JC for qemu-devel@nongnu.org; Wed, 25 May 2016 08:30:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Xwm-0000tj-7W; Wed, 25 May 2016 08:30:00 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D0BF812B36; Wed, 25 May 2016 12:29:59 +0000 (UTC) Received: from noname.redhat.com (ovpn-116-86.ams2.redhat.com [10.36.116.86]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4PCTOph020236; Wed, 25 May 2016 08:29:57 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Wed, 25 May 2016 14:29:23 +0200 Message-Id: <1464179363-19821-16-git-send-email-kwolf@redhat.com> In-Reply-To: <1464179363-19821-1-git-send-email-kwolf@redhat.com> References: <1464179363-19821-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 25 May 2016 12:29:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 15/15] blockjob: Remove BlockJob.bs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, berto@igalia.com, jcody@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- blockjob.c | 1 - include/block/blockjob.h | 1 - qemu-img.c | 2 +- tests/test-blockjob-txn.c | 3 ++- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/blockjob.c b/blockjob.c index 2097e1d..c095cc5 100644 --- a/blockjob.c +++ b/blockjob.c @@ -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; diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 32012af..86d2807 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -82,7 +82,6 @@ struct BlockJob { const BlockJobDriver *driver; /** The block device on which the job is operating. */ - BlockDriverState *bs; /* TODO Remove */ BlockBackend *blk; /** diff --git a/qemu-img.c b/qemu-img.c index 2065348..4b56ad3 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -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); diff --git a/tests/test-blockjob-txn.c b/tests/test-blockjob-txn.c index 55fad95..828389b 100644 --- a/tests/test-blockjob-txn.c +++ b/tests/test-blockjob-txn.c @@ -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)) {