From patchwork Tue May 31 09:15:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 628085 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 3rJpHW1YMwz9sCp for ; Tue, 31 May 2016 19:35:03 +1000 (AEST) Received: from localhost ([::1]:35452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7g4i-0006Tr-P6 for incoming@patchwork.ozlabs.org; Tue, 31 May 2016 05:35:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7fmO-0006JU-4l for qemu-devel@nongnu.org; Tue, 31 May 2016 05:16:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7fmI-0005X1-Dl for qemu-devel@nongnu.org; Tue, 31 May 2016 05:16:03 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:18754 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7fmH-0005Wh-UJ for qemu-devel@nongnu.org; Tue, 31 May 2016 05:15:58 -0400 Received: from irbis.sw.ru ([10.30.2.139]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u4V9FUaM003235; Tue, 31 May 2016 12:15:44 +0300 (MSK) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Date: Tue, 31 May 2016 12:15:25 +0300 Message-Id: <1464686130-12265-7-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1464686130-12265-1-git-send-email-den@openvz.org> References: <1464686130-12265-1-git-send-email-den@openvz.org> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Subject: [Qemu-devel] [PATCH 06/11] block: remove BlockDriver.bdrv_write_compressed 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: Kevin Wolf , Pavel Butsykin , Jeff Cody , Markus Armbruster , Stefan Hajnoczi , den@openvz.org, John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pavel Butsykin There are no block drivers left that implement the old .bdrv_write_compressed interface, so it can be removed now. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoczi CC: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/io.c | 15 --------------- include/block/block_int.h | 3 --- qemu-img.c | 2 +- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/block/io.c b/block/io.c index 54cd9a4..4b06de8 100644 --- a/block/io.c +++ b/block/io.c @@ -1825,7 +1825,6 @@ int bdrv_pwrite_compressed(BlockDriverState *bs, int64_t offset, { BdrvWriteCompressedCo data; QEMUIOVector qiov; - BlockDriver *drv = bs->drv; struct iovec iov = { .iov_base = (void *)buf, .iov_len = count, @@ -1839,20 +1838,6 @@ int bdrv_pwrite_compressed(BlockDriverState *bs, int64_t offset, .ret = -EINPROGRESS, }; - if (!drv) { - return -ENOMEDIUM; - } - - if (drv->bdrv_write_compressed) { - int ret = bdrv_check_byte_request(bs, offset, count); - if (ret < 0) { - return ret; - } - assert(QLIST_EMPTY(&bs->dirty_bitmaps)); - return drv->bdrv_write_compressed(bs, offset >> BDRV_SECTOR_BITS, buf, - count >> BDRV_SECTOR_BITS); - } - if (qemu_in_coroutine()) { /* Fast-path if already in coroutine context */ bdrv_write_compressed_co_entry(&data); diff --git a/include/block/block_int.h b/include/block/block_int.h index ccba9c9..09b9002 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -204,9 +204,6 @@ struct BlockDriver { bool has_variable_length; int64_t (*bdrv_get_allocated_file_size)(BlockDriverState *bs); - int (*bdrv_write_compressed)(BlockDriverState *bs, int64_t sector_num, - const uint8_t *buf, int nb_sectors); - int coroutine_fn (*bdrv_co_write_compressed)(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov); diff --git a/qemu-img.c b/qemu-img.c index ab54027..8195b93 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2024,7 +2024,7 @@ static int img_convert(int argc, char **argv) const char *preallocation = qemu_opt_get(opts, BLOCK_OPT_PREALLOC); - if (!drv->bdrv_write_compressed && !drv->bdrv_co_write_compressed) { + if (!drv->bdrv_co_write_compressed) { error_report("Compression not supported for this file format"); ret = -1; goto out;