From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8qYe-0006FA-1a for qemu-devel@nongnu.org; Mon, 12 Aug 2013 07:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8qYZ-0002ZY-D7 for qemu-devel@nongnu.org; Mon, 12 Aug 2013 07:45:07 -0400 Received: from mail-qa0-x22f.google.com ([2607:f8b0:400d:c00::22f]:53268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8qYZ-0002ZA-5f for qemu-devel@nongnu.org; Mon, 12 Aug 2013 07:45:03 -0400 Received: by mail-qa0-f47.google.com with SMTP id o19so934858qap.20 for ; Mon, 12 Aug 2013 04:45:02 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20130812112814.GA20725@stefanha-thinkpad.redhat.com> References: <1376237638-6968-1-git-send-email-pbonzini@redhat.com> <1376237638-6968-2-git-send-email-pbonzini@redhat.com> <20130812112814.GA20725@stefanha-thinkpad.redhat.com> Date: Mon, 12 Aug 2013 13:45:02 +0200 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] vmdk: support vmfsSparse files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Fam Zheng , qemu-devel On Mon, Aug 12, 2013 at 1:28 PM, Stefan Hajnoczi wrote= : > On Sun, Aug 11, 2013 at 06:13:57PM +0200, Paolo Bonzini wrote: >> @@ -505,6 +505,34 @@ static int vmdk_open_vmdk3(BlockDriverState *bs, >> return ret; >> } >> >> +static int vmdk_open_vmfs_sparse(BlockDriverState *bs, >> + BlockDriverState *file, >> + int flags) >> +{ >> + int ret; >> + uint32_t magic; >> + VMDK3Header header; >> + VmdkExtent *extent; >> + >> + ret =3D bdrv_pread(file, sizeof(magic), &header, sizeof(header)); >> + if (ret < 0) { >> + return ret; >> + } > > magic is unused. Did you forget to check it? Andreas F=E4rber pointed out that we're only using the sizeof(magic), not the actual variable. Feel free to ignore my comment, at least the code documents that the uint32_t offset belongs to the magic number before the header. Stefan