From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3VgE-0004JL-2e for qemu-devel@nongnu.org; Thu, 19 May 2016 17:40:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3VgA-0007Z5-1N for qemu-devel@nongnu.org; Thu, 19 May 2016 17:40:29 -0400 Received: from mx1.parallels.com ([199.115.104.18]:36489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Vg9-0007Ks-RW for qemu-devel@nongnu.org; Thu, 19 May 2016 17:40:25 -0400 References: <1463229957-14253-1-git-send-email-den@openvz.org> <1463229957-14253-2-git-send-email-den@openvz.org> <20160519212554.GH24257@stefanha-x1.localdomain> From: "Denis V. Lunev" Message-ID: <573E328B.4090801@virtuozzo.com> Date: Fri, 20 May 2016 00:39:23 +0300 MIME-Version: 1.0 In-Reply-To: <20160519212554.GH24257@stefanha-x1.localdomain> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/10] block/io: add bdrv_co_write_compressed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , "Denis V. Lunev" Cc: Kevin Wolf , Pavel Butsykin , Jeff Cody , Markus Armbruster , qemu-devel@nongnu.org, John Snow On 05/20/2016 12:25 AM, Stefan Hajnoczi wrote: > On Sat, May 14, 2016 at 03:45:49PM +0300, Denis V. Lunev wrote: >> diff --git a/block/io.c b/block/io.c >> index cd6d71a..88af10c 100644 >> --- a/block/io.c >> +++ b/block/io.c >> @@ -1828,8 +1828,8 @@ int bdrv_is_allocated_above(BlockDriverState *top, >> return 0; >> } >> >> -int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num, >> - const uint8_t *buf, int nb_sectors) >> +int bdrv_co_write_compressed(BlockDriverState *bs, int64_t sector_num, >> + int nb_sectors, QEMUIOVector *qiov) > Please use the coroutine_fn attribute to declare that this function must > be called in coroutine context. > >> diff --git a/include/block/block_int.h b/include/block/block_int.h >> index a029c20..3c93ddb 100644 >> --- a/include/block/block_int.h >> +++ b/include/block/block_int.h >> @@ -208,6 +208,9 @@ struct BlockDriver { >> int (*bdrv_write_compressed)(BlockDriverState *bs, int64_t sector_num, >> const uint8_t *buf, int nb_sectors); >> >> + int (*bdrv_co_write_compressed)(BlockDriverState *bs, int64_t sector_num, >> + int nb_sectors, QEMUIOVector *qiov); > Please add the coroutine_fn attribute just like .bdrv_co_readv() and > friends. yep. This seems right thing to do.