From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLXWH-0004t1-R0 for qemu-devel@nongnu.org; Wed, 11 Feb 2015 08:39:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLXWE-0002ub-Ln for qemu-devel@nongnu.org; Wed, 11 Feb 2015 08:39:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLXWE-0002uP-EC for qemu-devel@nongnu.org; Wed, 11 Feb 2015 08:39:54 -0500 Date: Wed, 11 Feb 2015 13:39:43 +0000 From: Stefan Hajnoczi Message-ID: <20150211133943.GA6101@stefanha-thinkpad.redhat.com> References: <1423399192-8569-1-git-send-email-gongxiaodong1@huawei.com> <20150209145428.GB2076@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline In-Reply-To: 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: Kevin Wolf , Stefan Hajnoczi , "qemu-devel@nongnu.org" , Xiaodong Gong --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 10, 2015 at 11:04:31PM +0800, Xiaodong Gong wrote: > On Mon, Feb 9, 2015 at 10:54 PM, Stefan Hajnoczi wro= te: >=20 > > 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. > > > > > > Add a re-probe for the last sector to FIXED base vpc image,when get > > > a NULL or raw driver in first sector probe. > > > > > > 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 > > >=20 >=20 > It works, but this probing of format sounds good . Giving a argument of bs > to bdrv_probe and each of funtion of probe get it's own checking method is > better, but the foot-print of patch is longer. I'm not suggesting a longer patch. Can the vpc .bdrv_open() code that loads the backing filename also set bs->backing_format to "vpc" so QEMU will always use vpc for the backing file? Stefan --T4sUOijqQbZv57TR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU21ufAAoJEJykq7OBq3PI+YoH/2Dyn4ApVNUSH9F1q4TNG66F kLFimsu10kewCFk8EME3hrjtWxNva51wT6yR6oFThkDl585zqzLLS9+yQG1jhTZ8 3FXr7gWmOFmeAOIhwFlVlTq6l4INH79U/n9G7Dje9UGIDsAqASRA+PCzu5KknA4+ 5y3baSj0WqODiPF9sW289TSitt5idi1g1KbXi6bTxfSAIA9x7QNm1ryKLVhCiEzZ KqyGNMauU4TAGSaUR9hxofatZX1TDVA2U+R0V8ty8zvhreId9PA378ATRqoa8yz+ s3OBiszRKAg1MkfIDD7GT72c7NU0Jg7tjDkppJkzgQZLSDcLFYiDBPAnAhARw18= =9/zK -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR--