From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uly6R-0002nT-Bj for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:09:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uly6K-0004h6-AJ for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:09:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uly6K-0004go-3m for qemu-devel@nongnu.org; Mon, 10 Jun 2013 05:09:20 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5A99JYI001883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Jun 2013 05:09:19 -0400 Date: Mon, 10 Jun 2013 11:09:15 +0200 From: Kevin Wolf Message-ID: <20130610090915.GB3636@dhcp-200-207.str.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: jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Am 09.06.2013 um 03:44 hat Fam Zheng geschrieben: > Refuse to open higher version for safety. > > 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. > > Signed-off-by: Fam Zheng Yes, it's definitely a good idea to add a check. > @@ -558,6 +558,10 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, > header = footer.header; > } > > + if (le32_to_cpu(header.version) >= 3) { > + return -EINVAL; > + } > + Other block drivers return -ENOTSUP for this case, and also call qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, ...) so that you get a meaningful error message. Can you model the VMDK code after them? Kevin