From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uly6C-0002hh-Tl for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:09:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uly68-0004fB-Ee for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:09:12 -0400 Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]:54522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uly68-0004f5-8a for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:09:08 -0400 Received: by mail-ea0-f169.google.com with SMTP id h15so5253935eak.14 for ; Mon, 10 Jun 2013 02:09:07 -0700 (PDT) Date: Mon, 10 Jun 2013 11:09:04 +0200 From: Stefan Hajnoczi Message-ID: <20130610090904.GA5745@stefanha-thinkpad.redhat.com> References: <1370742255-16400-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1370742255-16400-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH] vmdk: refuse to open higher version than supported List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Sun, Jun 09, 2013 at 09:44:15AM +0800, Fam Zheng wrote: > Although we try to be compatible with published VMDK spec, VMware has > newer version from ESXi 5.1 exported OVF/OVA, which we have no knowledge > what's changed in it. And it is very likely to have more new versions in > the future, so it's not safe to open them blindly. The best I could find was this high-level overview: http://myvirtualcloud.net/?p=3829 > Signed-off-by: Fam Zheng > --- > block/vmdk.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/block/vmdk.c b/block/vmdk.c > index 608daaf..d9c2368 100644 > --- a/block/vmdk.c > +++ b/block/vmdk.c > @@ -558,6 +558,10 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, > header = footer.header; > } > > + if (le32_to_cpu(header.version) >= 3) { > + return -EINVAL; > + } > + Looks fine, the VMDK 5.0 spec says header.version may be 1 or 2. Reviewed-by: Stefan Hajnoczi