From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2e1O-0000S8-GF for qemu-devel@nongnu.org; Tue, 17 May 2016 08:22:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2e1K-00057R-5k for qemu-devel@nongnu.org; Tue, 17 May 2016 08:22:45 -0400 Received: from mail-am1on0109.outbound.protection.outlook.com ([157.56.112.109]:2657 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2e1J-000575-MM for qemu-devel@nongnu.org; Tue, 17 May 2016 08:22:42 -0400 References: <1463229957-14253-1-git-send-email-den@openvz.org> <1463229957-14253-6-git-send-email-den@openvz.org> <5739FC05.9000705@redhat.com> From: Pavel Butsykin Message-ID: <573B0D0A.9050902@virtuozzo.com> Date: Tue, 17 May 2016 15:22:34 +0300 MIME-Version: 1.0 In-Reply-To: <5739FC05.9000705@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/10] block: remove BlockDriver.bdrv_write_compressed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , "Denis V. Lunev" , qemu-devel@nongnu.org Cc: Jeff Cody , Markus Armbruster , John Snow , Stefan Hajnoczi , Kevin Wolf On 16.05.2016 19:57, Eric Blake wrote: > On 05/14/2016 06:45 AM, Denis V. Lunev wrote: >> 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 >> --- > >> +++ b/block/io.c >> @@ -1876,7 +1876,6 @@ static void bdrv_write_compressed_co_entry(void *opaque) >> int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num, >> const uint8_t *buf, int nb_sectors) >> { >> - BlockDriver *drv = bs->drv; >> BdrvWriteCompressedCo data = { >> .bs = bs, >> .sector_num = sector_num, >> @@ -1885,19 +1884,6 @@ int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num, >> .ret = -EINPROGRESS, >> }; >> >> - if (!drv) { >> - return -ENOMEDIUM; >> - } > > Why are you deleting this check? > Because this check is duplicated in bdrv_co_write_compressed(), but in this place it was necessary for drv->bdrv_write_compressed.