From nobody Wed Nov 12 05:24:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1568301407; cv=none; d=zoho.com; s=zohoarc; b=SofFep7Q1l/aJPKOj7z18mwv8protZARdnOtZOqlQWSkhZzdH3sx5YnMw4NVDo7f8w2TjDo1Q0ayP2cOinLtN9+gKVY72lnkPXP+ISKpjMW/9mim5jjgGwgnbBmQM2Qoad7J9mHJ2ovALePLAfY79x7cBx7WY2oJOES/MwDX7GY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568301407; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=x5YxWMheaTJKfFgXnBwEKqjJ6EWPrJOl3+uz7B6salQ=; b=VlBsloXpQFnF+rO9sYepZqnbNcYR/IrbFOnb+JhqH0otT+orPSeRpNk1MVwy8eZPbP+EcaP/Dqg2rx6JNDGLU0Mp9Tv66zqvlEAoRi1Jm+42Uk4OTilFpxRZtsALsdmvhc0QZ65AuV1F/mH6Y38VcmB2WJf+6vSqHxPwzvUx3sc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568301407759544.655998086948; Thu, 12 Sep 2019 08:16:47 -0700 (PDT) Received: from localhost ([::1]:35756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8Qpt-0003pw-Ph for importer@patchew.org; Thu, 12 Sep 2019 11:16:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38363) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8Qn5-00024y-83 for qemu-devel@nongnu.org; Thu, 12 Sep 2019 11:13:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8Qn3-00036S-8B for qemu-devel@nongnu.org; Thu, 12 Sep 2019 11:13:47 -0400 Received: from relay.sw.ru ([185.231.240.75]:57858) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i8Qmz-00034B-SZ; Thu, 12 Sep 2019 11:13:42 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92) (envelope-from ) id 1i8Qmw-0000kk-Tj; Thu, 12 Sep 2019 18:13:39 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Date: Thu, 12 Sep 2019 18:13:36 +0300 Message-Id: <20190912151338.21225-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190912151338.21225-1-vsementsov@virtuozzo.com> References: <20190912151338.21225-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH 2/4] block/block-backend: add blk_co_pwritev_part X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, qemu-devel@nongnu.org, mreitz@redhat.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Add blk write function with qiov_offset parameter. It's needed for the following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/sysemu/block-backend.h | 4 ++++ block/block-backend.c | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 368d53af77..73f2cef7fe 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -121,6 +121,10 @@ void blk_set_dev_ops(BlockBackend *blk, const BlockDev= Ops *ops, void *opaque); int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); +int coroutine_fn blk_co_pwritev_part(BlockBackend *blk, int64_t offset, + unsigned int bytes, + QEMUIOVector *qiov, size_t qiov_offse= t, + BdrvRequestFlags flags); int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); diff --git a/block/block-backend.c b/block/block-backend.c index 1c605d5444..b3d00478af 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1176,9 +1176,10 @@ int coroutine_fn blk_co_preadv(BlockBackend *blk, in= t64_t offset, return ret; } =20 -int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, - BdrvRequestFlags flags) +int coroutine_fn blk_co_pwritev_part(BlockBackend *blk, int64_t offset, + unsigned int bytes, + QEMUIOVector *qiov, size_t qiov_offse= t, + BdrvRequestFlags flags) { int ret; BlockDriverState *bs; @@ -1205,11 +1206,19 @@ int coroutine_fn blk_co_pwritev(BlockBackend *blk, = int64_t offset, flags |=3D BDRV_REQ_FUA; } =20 - ret =3D bdrv_co_pwritev(blk->root, offset, bytes, qiov, flags); + ret =3D bdrv_co_pwritev_part(blk->root, offset, bytes, qiov, qiov_offs= et, + flags); bdrv_dec_in_flight(bs); return ret; } =20 +int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, + unsigned int bytes, QEMUIOVector *qiov, + BdrvRequestFlags flags) +{ + return blk_co_pwritev_part(blk, offset, bytes, qiov, 0, flags); +} + typedef struct BlkRwCo { BlockBackend *blk; int64_t offset; --=20 2.21.0