From patchwork Fri Jul 22 08:17:41 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: 651583 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 3rwkRN35x4z9sC3 for ; Fri, 22 Jul 2016 18:32:32 +1000 (AEST) Received: from localhost ([::1]:45860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQVsk-00024m-4b for incoming@patchwork.ozlabs.org; Fri, 22 Jul 2016 04:32:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQVey-00060Z-3u for qemu-devel@nongnu.org; Fri, 22 Jul 2016 04:18:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQVev-0001vA-TJ for qemu-devel@nongnu.org; Fri, 22 Jul 2016 04:18:15 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:30816 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQVev-0001qe-3I for qemu-devel@nongnu.org; Fri, 22 Jul 2016 04:18:13 -0400 Received: from irbis.sw.ru ([10.30.2.139]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u6L0IZx9024246; Thu, 21 Jul 2016 03:18:37 +0300 (MSK) From: "Denis V. Lunev" To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Fri, 22 Jul 2016 11:17:41 +0300 Message-Id: <1469175475-15420-3-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1469175475-15420-1-git-send-email-den@openvz.org> References: <1469175475-15420-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 v7 02/16] block: Convert bdrv_pwrite_compressed() to BdrvChild 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 Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoczi CC: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 2 +- block/io.c | 3 ++- include/block/block.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 8f38ab4..4bfc2eb 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1477,7 +1477,7 @@ int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *buf, return ret; } - return bdrv_pwrite_compressed(blk_bs(blk), offset, buf, count); + return bdrv_pwrite_compressed(blk->root, offset, buf, count); } int blk_truncate(BlockBackend *blk, int64_t offset) diff --git a/block/io.c b/block/io.c index e9f35c6..1503e09 100644 --- a/block/io.c +++ b/block/io.c @@ -1867,9 +1867,10 @@ int bdrv_is_allocated_above(BlockDriverState *top, return 0; } -int bdrv_pwrite_compressed(BlockDriverState *bs, int64_t offset, +int bdrv_pwrite_compressed(BdrvChild *child, int64_t offset, const void *buf, int bytes) { + BlockDriverState *bs = child->bs; BlockDriver *drv = bs->drv; int ret; diff --git a/include/block/block.h b/include/block/block.h index b4a97f2..7bb5ddb 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -399,7 +399,7 @@ const char *bdrv_get_node_name(const BlockDriverState *bs); const char *bdrv_get_device_name(const BlockDriverState *bs); const char *bdrv_get_device_or_node_name(const BlockDriverState *bs); int bdrv_get_flags(BlockDriverState *bs); -int bdrv_pwrite_compressed(BlockDriverState *bs, int64_t offset, +int bdrv_pwrite_compressed(BdrvChild *child, int64_t offset, const void *buf, int bytes); int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs);