From patchwork Tue Nov 15 06:36:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Butsykin X-Patchwork-Id: 9429575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4B70D60484 for ; Tue, 15 Nov 2016 12:12:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3533728B26 for ; Tue, 15 Nov 2016 12:12:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27E0528B6C; Tue, 15 Nov 2016 12:12:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A2FD28B26 for ; Tue, 15 Nov 2016 12:12:16 +0000 (UTC) Received: from localhost ([::1]:45866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6cb1-0001aH-5f for patchwork-qemu-devel@patchwork.kernel.org; Tue, 15 Nov 2016 07:12:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6caV-0001Z6-Uo for qemu-devel@nongnu.org; Tue, 15 Nov 2016 07:11:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6caS-0006JY-OH for qemu-devel@nongnu.org; Tue, 15 Nov 2016 07:11:43 -0500 Received: from mail-db5eur01on0133.outbound.protection.outlook.com ([104.47.2.133]:27660 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6caS-0006JM-EC; Tue, 15 Nov 2016 07:11:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JmC7AMsOsxnl6N/RKBghkZUINtTytGkJV8R5cSSQiIs=; b=JISSgXMW0doP+/IZvj0TW0lF/uBsvjukx5MB1f851PEJ1Ifo+tHQ1ZqzAiuSFPtUXhXimMn5Ntwxb3ZzKEGdtZVGUjFDJG7bqV+jCrzn+sq/g9TKFGz8E7weuW7QO162y/6s5OxWI3VaT1HQTDJIQ72ljPszOaAuTZ6Qio97U2w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pbutsykin@virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.10) by VI1PR0802MB2558.eurprd08.prod.outlook.com (10.172.255.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10; Tue, 15 Nov 2016 06:38:11 +0000 From: Pavel Butsykin To: , Date: Tue, 15 Nov 2016 09:36:58 +0300 Message-ID: <20161115063715.12561-2-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161115063715.12561-1-pbutsykin@virtuozzo.com> References: <20161115063715.12561-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: AM5PR0101CA0010.eurprd01.prod.exchangelabs.com (10.169.240.20) To VI1PR0802MB2558.eurprd08.prod.outlook.com (10.172.255.136) X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2558; 2:3z1q1k24iS8Nr6xh4+dKcw3MilIDNe7ZPnY0dg9dmrNDlTeWkYTvV+cpTixb2E9LaGnZNiT6l4l9GhgcUqF4pN6m74PlmqHI/Qw9mwaJBv29nF7JEAhdmwUHWRC0UxMqB/2zd7KDtBwqOEYbSk1vyhyfCrgfNhQCcLUP8n8RVx8=; 3:K8luDav7gl+KGzEdymiQI2gapuBGH2pPho3/a32jETbffIeZumlAOEoPHhgLlQqGnPwhdmUf/upFg2fxiwKoL5d+oOyoAEyDOnd8kmQRgvsiPJd4cQgcMw/96WxcOUupUSQRtfmLALXzcpxwj6eIFZmOm+tVy4rVQO55ZkwjMjo=; 25:9OTNOWufpclrIKsslE+IID0Fnfz/dnEvft1ffmE9XqIwGI3iRxnlJD0oJxnqIK1HYbn+divoXxPEM1bOPle6LBPiBCzk/6m+hGFplPvq/4N3x8iznkIpzQ9N8ySQrMKVzGYaJc1Z8/Uj5F8sVk8lMAsV+v+xryGv+fF7r8ncmAXCkGM2DMR4n4Pfpj5MBQsDCopL7FgIll29V2sK4oWqRtbqHcr5yDC8THjCzbDcTAKaVuM0LVnE00jeDUaQ8/6AsAJvFd65NQrB3ZMBbV7eEXSt2lRAh8RbQEEtzfvqeNAHXBDbq6u2Ato2tIMYrmwxXDcoNKPQHby8ZRyAcEM6bd6uvOYk3HhBFhSnXCRWHMpQ4PiPTdCN4oeK1mg+3hcAAX3+eF20N2xMfuhIGdpsTByZWDVVZRjzvKGAnMbKF+Zc9fXbBSx2cv31JU1jLq2k X-MS-Office365-Filtering-Correlation-Id: 3d58088b-1398-4a10-aa87-08d40d21f87b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:VI1PR0802MB2558; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2558; 31:9DDvNUCcl+FzKMu5iWxBy5kMkCbaGWZIkS2N9ErST2nNbGpSY1GgWuN1KKT9HcWXYQ1GrHsVox42N8f7ozzzOIaVZm/liG/TEw/TGYjmrB/pCLhvCM4iZIZQVNrAm+TCC3/m88oJRbZKdhOcn7zamAPsmLAU2ypLVl/zXRu2NmtarQQ9Ux3n7/IkClaHJtvYFcb6SCDIbxire9nW/DPN1TccZ2VLjNZ9rrB2z6wVcgBYy3vIvvJW9JgjXkoWwl73; 20:780IkfSWbBVm0Q25Swj9wDjLllTOzFYrLavwUKbyM8ClGMlzWSfIrvmUhbqoCFpRWy9tzodnHkHM4unCSomi6XQKtcgIT5atDbe8+5OqjGsvcpJ97TgRsR+BbjfcSlzmY3gffXyYFKS1I+qizPrlUU1S0Q1QZZB/N4JhM57g1h0=; 4:+gjol11+NSQTIraELLRBGXFsn8Y77Slw32wdezuKhPvE6rv4HdmTUTCcmWI3MVKmI85/6cixiBG4hJlmFK6D32QyC20KyHqZ298tgoWWmXg5y7l1icLxHqBlemX1uQN9I8i1jqw97LW+QzqHhN8IfIabb6tNU9I64x6fCeRwGtKEDKD9deXZx5RgQhDghzOFTxSwFBSZ9xKv/ZxUQB45ilOWctrucRWDMc0Af8fcnYOWWz7Xzz/NGQiSnynZP8SltS+1SXSji/AV5zdu9Jdu8XWpnVXpw9ZALHMPLnPkXpoerCqHy5lp5NPt/GYf3zyy+OOTCt1aUth9SjnTj21Az2LF3jCWE1lb/Lun5AYWDhr5B8xw/oEUCJDudmb20RTDhRI5mDY19R0kR/tTp4O5IbRidPrkyFdofAwlgB4HNVrKDtM277fI3NgA20+Zui4c X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6061324)(6043046); SRVR:VI1PR0802MB2558; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0802MB2558; X-Forefront-PRVS: 012792EC17 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(47776003)(105586002)(101416001)(1076002)(68736007)(106356001)(6666003)(76176999)(305945005)(4326007)(97736004)(66066001)(53416004)(189998001)(42186005)(69596002)(2906002)(7736002)(5001770100001)(7846002)(86362001)(48376002)(50226002)(2950100002)(50466002)(50986999)(5003940100001)(33646002)(77096005)(81156014)(8676002)(92566002)(81166006)(3846002)(36756003)(6116002)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0802MB2558; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0802MB2558; 23:+sFO3hd6S9Z8q0yfvEDCMvhZKh1KGodoM3z+3bV?= =?us-ascii?Q?MtoOqH9OtX/KTPZwkasLsHaUt6pS/GRggMKCfoyg09b8i60W0zWesaS9OzlP?= =?us-ascii?Q?eehkt4AmLE+wr+cjIY76V8gDZ6lgwzeEABFnEPIhSXUEaqvC5rNE3CH1hiwV?= =?us-ascii?Q?GtRlJaunOH7IwpeYGeRDo5YoV5S4dbUQAsxpK8zEeDd97KMEx7lKevGBwQ3m?= =?us-ascii?Q?EZGxNVlyY0Qscv3/qEWIxtsa+0bQZ/6eGIfSNvni1NTTCdtceWGqmv9DExoI?= =?us-ascii?Q?n9SvKn3+OLdtUi+Gs4WdkwikNNmMd1aGOpdSIYfwwy7Y+oE9x2JzkXHSUKvj?= =?us-ascii?Q?PcVG4S5YdBbY8uuEIcewXLAzAZU7fGAc0e8I5Ouzlv31Bbn3CAYF0Ut8SoMQ?= =?us-ascii?Q?rzxajYcJlQZ8xJDHU9fzKTtqKjTh704890G9aw0DGjbhcpfm7fk2YN+MXfBM?= =?us-ascii?Q?/T2wA47IvP2sfWgojjWaTKYd1tuwXe6HNqZduJXsABLVL2omKusOmhiyvb6R?= =?us-ascii?Q?tLmOm8gZNmITj9nZGRYVAacAIVHKgs7CtWN+eZgcqhm7Xbq/4ZniKkcFO1L1?= =?us-ascii?Q?r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V8+DQHn5hpKAsZEpLExRsM9LVvr+wGrGiSBG+6o0Ys4aDaY0N4pl5slnbnJj5jTcQBBJwgxe7+6XZe5OGuLjflI04wBYW1NjA4YHmaq30EhLD4wL/2SH180OREFoU0dVoBw4srStsEY9lNWo1M=; 24:m1sKZ1o0SZO7yk8cBYw5gSXLcmD1JbUSd8lIRQDFA5eg4CHRzuvXLQAqDoS4+MERn6E8G3oo3IqyZSWpfd06EeYOtXKvzoJ8lNI39MmMSVs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2558; 7:Q2ryVeHxcnZesQZlynWAHU4lxJ7c+zCklkxO7mPeNS6bZzlks99eiZk+GxabVxRnu6MFcgCIbRm9HoRpzLvK8dJz/Mlb1GJrZaw8ToqZHYe7piqmwLoQthjx6gvJD5JI6ZecIXoK3AROfxbiKLVYrwETyXn8bWBH4Pz2uBvY9BcbusHWDNVu73Tl2HP6HuJ+zyH5DSMYJSh1hVc31t/vHZTApqfA31zEKTEYPiXWeqpdPb1RUVwmWZP24P0erUQR+bfwURz/LcHZXPABBslN3UpI3Ll0qFwapA9GAnZfdqLcQllFYcqTaN3qgh7vPHeN/muhCItntQWxNbPH/v6la2IoFQnDx3qYNauNhNKJqHg=; 20:xI6xbuJ52FPmysTK98VXUmWC2PojtA8iN8rViJKcRhyeRi9OqaAh9tv1zlFjoloTcVscfINIsy9gUqaNFrB1XWH+odrQCoC6fhar1q9xKrbtdqKKD2LHrT3s+V39jTQzYh2ASIL2EilVzow12n6RFexxv8bRB440Do1dAoZ0izg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2016 06:38:11.3142 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2558 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.133 Subject: [Qemu-devel] [PATCH v1 01/18] block/io: add bdrv_aio_{preadv, pwritev} 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, famz@redhat.com, mreitz@redhat.com, stefanha@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP It's just byte-based wrappers over bdrv_co_aio_prw_vector(), which provide a byte-based interface for AIO read/write. Signed-off-by: Pavel Butsykin --- block/io.c | 16 ++++++++++++++++ include/block/block.h | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/block/io.c b/block/io.c index fdf7080..099bddb 100644 --- a/block/io.c +++ b/block/io.c @@ -1991,6 +1991,22 @@ int bdrv_readv_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos) /**************************************************************/ /* async I/Os */ +BlockAIOCB *bdrv_aio_preadv(BdrvChild *child, int64_t offset, + QEMUIOVector *qiov, unsigned int bytes, + BlockCompletionFunc *cb, void *opaque) +{ + assert(bytes == qiov->size); + return bdrv_co_aio_prw_vector(child, offset, qiov, 0, cb, opaque, false); +} + +BlockAIOCB *bdrv_aio_pwritev(BdrvChild *child, int64_t offset, + QEMUIOVector *qiov, unsigned int bytes, + BlockCompletionFunc *cb, void *opaque) +{ + assert(bytes == qiov->size); + return bdrv_co_aio_prw_vector(child, offset, qiov, 0, cb, opaque, true); +} + BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, void *opaque) diff --git a/include/block/block.h b/include/block/block.h index e18233a..6728219 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -305,6 +305,13 @@ BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs, const char *node_name, Error **errp); /* async block I/O */ + +BlockAIOCB *bdrv_aio_preadv(BdrvChild *child, int64_t offset, + QEMUIOVector *qiov, unsigned int bytes, + BlockCompletionFunc *cb, void *opaque); +BlockAIOCB *bdrv_aio_pwritev(BdrvChild *child, int64_t offset, + QEMUIOVector *qiov, unsigned int bytes, + BlockCompletionFunc *cb, void *opaque); BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num, QEMUIOVector *iov, int nb_sectors, BlockCompletionFunc *cb, void *opaque);