From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1eHg-0005vg-2g for qemu-devel@nongnu.org; Mon, 30 Jun 2014 12:18:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1eHY-0001qK-JB for qemu-devel@nongnu.org; Mon, 30 Jun 2014 12:18:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1eHY-0001qA-Bk for qemu-devel@nongnu.org; Mon, 30 Jun 2014 12:18:16 -0400 Message-ID: <53B18DBF.8040506@redhat.com> Date: Mon, 30 Jun 2014 18:18:07 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1404143260-9368-1-git-send-email-ming.lei@canonical.com> <1404143260-9368-2-git-send-email-ming.lei@canonical.com> <53B18BF3.6020403@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 1/3] block: block: introduce bdrv_io_plug() and bdrv_io_unplug() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei Cc: Kevin Wolf , Peter Maydell , Fam Zheng , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Stefan Hajnoczi Il 30/06/2014 18:15, Ming Lei ha scritto: >>> >> +int bdrv_io_unplug(BlockDriverState *bs) >>> >> +{ >>> >> + BlockDriver *drv = bs->drv; >>> >> + if (drv && drv->bdrv_io_unplug) { >>> >> + return drv->bdrv_io_unplug(bs); >>> >> + } else if (bs->file) { >>> >> + return bdrv_io_unplug(bs->file); >>> >> + } >>> >> + return 0; >> > >> > >> > I think this should return void (and that's how you use it in patch 3 >> > indeed). If you fix this you can add my Reviewed-by tag. > It can be used to trace how many IO are submitted at batch, > otherwise device can't know this information at all. Having a return value however suggests that bdrv_io_unplug can fail. So this should be documented. For now, I'd prefer to keep it simple. Paolo