Received: from eggs.gnu.org ([2001:4830:134:3::10]:35355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtvH3-0001e3-81 for qemu-devel@nongnu.org; Fri, 20 Dec 2013 03:17:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtvGy-0007wh-EE for qemu-devel@nongnu.org; Fri, 20 Dec 2013 03:17:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtvGy-0007vQ-5w for qemu-devel@nongnu.org; Fri, 20 Dec 2013 03:17:28 -0500 Date: Fri, 20 Dec 2013 09:17:14 +0100 From: Stefan Hajnoczi Message-ID: <20131220081714.GA15789@stefanha-thinkpad.redhat.com> References: <1387504128-15347-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1387504128-15347-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] vmdk: Allow vmdk_create to work with protocol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, pl@kamp.de, qemu-devel@nongnu.org On Fri, Dec 20, 2013 at 09:48:48AM +0800, Fam Zheng wrote: > This improves vmdk_create to use bdrv_* functions to replace qemu_open > and other fd functions. The error handling are improved as well. One > difference is that bdrv_pwrite will round up buffer to sectors, so for > description file, an extra bdrv_truncate is used in the end to drop > inding zeros. > > Notes: > > - A bonus bug fix is correct endian is used in initializing GD entries. > > - ROUND_UP and DIV_ROUND_UP are used where possible. > > I tested that new code produces exactly the same file as previously. > > Signed-off-by: Fam Zheng > > --- > v2: Address Stefan's comments: > > Signed-off-by: Fam Zheng > --- > block/vmdk.c | 164 ++++++++++++++++++++++++++++++++++------------------------- > 1 file changed, 95 insertions(+), 69 deletions(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan