From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5yQw-0005AC-Ok for qemu-devel@nongnu.org; Fri, 09 Mar 2012 06:56:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5yQq-0008Sm-FB for qemu-devel@nongnu.org; Fri, 09 Mar 2012 06:56:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5yQq-0008SQ-6c for qemu-devel@nongnu.org; Fri, 09 Mar 2012 06:56:24 -0500 Message-ID: <4F59F0B8.2010102@redhat.com> Date: Fri, 09 Mar 2012 12:59:52 +0100 From: Kevin Wolf MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/5] block: Virtual Bridges VERDE GOW disk image format, legacy GOW version 1 support implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: "Leonardo E. Reiter" , QEMU Developers Mailing List Am 09.03.2012 12:42, schrieb Stefan Hajnoczi: > On Thu, Mar 8, 2012 at 10:15 PM, Leonardo E. Reiter > wrote: >> +#ifndef _WIN32 >> +#include > > I recommend writing this in a platform-independent way using bdrv_*() > APIs to access the image file. This has been a requirement for all > block drivers. Legacy drivers have been updated too. The chance of > merging a new image format that uses platform-specific I/O APIs is low > IMO. Let's be clear here: It's not just low, it's zero. Maybe the qcow2-cache should be generalised so that replacing an mmap in other image formats becomes easier? >> +BlockDriver bdrv_gow1 = { >> + .format_name = "gow1", >> + .instance_size = sizeof(gow1_state_t), >> + .bdrv_probe = gow1_probe, >> + .bdrv_file_open = gow1_open, >> + .bdrv_close = gow1_close, >> + .bdrv_read = gow1_read, >> + .bdrv_write = gow1_write, > > Please implement .bdrv_co_readv()/.bdrv_co_writev() instead. They > work along the same lines - except they allow parallel requests. If > you don't want to handle parallel requests you can use a CoMutex to > serialize these functions. .bdrv_read/write allow parallel requests as well. The difference is that bdrv_co_readv/writev is vectored and therefore preferable. Kevin