From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKpjS-0000Bg-C9 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 09:54:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKpjM-0005W5-62 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 09:54:38 -0500 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:59725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKpjM-0005Uj-07 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 09:54:32 -0500 Received: by mail-we0-f179.google.com with SMTP id u56so21891527wes.10 for ; Mon, 09 Feb 2015 06:54:31 -0800 (PST) Date: Mon, 9 Feb 2015 14:54:28 +0000 From: Stefan Hajnoczi Message-ID: <20150209145428.GB2076@stefanha-thinkpad.redhat.com> References: <1423399192-8569-1-git-send-email-gongxiaodong1@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yNb1oOkm5a9FJOVX" Content-Disposition: inline In-Reply-To: <1423399192-8569-1-git-send-email-gongxiaodong1@huawei.com> Subject: Re: [Qemu-devel] [PATCH] block:Fix FIXED base vpc be probed to raw format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xiaodong Gong Cc: kwolf@redhat.com, Xiaodong Gong , qemu-devel@nongnu.org, stefanha@redhat.com --yNb1oOkm5a9FJOVX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 08, 2015 at 08:39:52PM +0800, Xiaodong Gong wrote: > When open the vpc snapshot based FIXED format, its backing file, > this FIXED vpc image, could be probed as a raw image, because that > the find_image_format just checkout the first sector. >=20 > Add a re-probe for the last sector to FIXED base vpc image,when get > a NULL or raw driver in first sector probe. >=20 > Signed-off-by: Xiaodong Gong > --- > block.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++------- > 1 file changed, 48 insertions(+), 7 deletions(-) This approach is likely to cause issues because it makes no distiction between headers and footers. Most image formats only have a header and would now be misdetected if a raw image had a header in its last sector. When a vpc image has a backing file, does it make sense to set the bs->backing_format to "vpc"? That way we'll try to open the backing file as a vpc image without probing. Stefan --yNb1oOkm5a9FJOVX Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU2MokAAoJEJykq7OBq3PIZ2YIAJwU7CnugztVcyWMiJppMA9b RpAjXB780hu2CsWkNDqvMYmffwOt0zdRV4MCtzRb3fMpsrxfSL/xkMNb5PUsvQDE +Yz3GOI6Eu+V6VDg8TxtlINVihMqqGq5HAMZr2yHpTFk4QrBuFNJJdTShEYFm/9G EonTQFyGHMmqt5m1nFu4o587ot6XkqCFAnb8ACJxnYQnXL8vDbxG87zCOpiREqDp 7Ogj1qk9jCMNOZM5aRl+JIgF+bhZ7VfMbkgIHKd83buUBlJ/nnsW72TkqzBRUEhd WXA7we24kLH5GxpUajY2KnqVvqLsd9yVD3E8GFo25qGNLtbc2Zebt0+4JbFp1ZE= =0/uW -----END PGP SIGNATURE----- --yNb1oOkm5a9FJOVX--