From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui1iD-0005dq-9V for qemu-devel@nongnu.org; Thu, 30 May 2013 08:12:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui1i8-0005zD-Hk for qemu-devel@nongnu.org; Thu, 30 May 2013 08:12:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui1i8-0005yO-7V for qemu-devel@nongnu.org; Thu, 30 May 2013 08:12:04 -0400 Message-ID: <51A74210.3000302@redhat.com> Date: Thu, 30 May 2013 06:12:00 -0600 From: Eric Blake MIME-Version: 1.0 References: <51A72673.7090300@linux.vnet.ibm.com> In-Reply-To: <51A72673.7090300@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2EMXDCFWFTXUEEFAMNRWW" Subject: Re: [Qemu-devel] [RFC] Check backing_file chain's loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dongxu Wang Cc: "kwolf@redhat.com" , qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2EMXDCFWFTXUEEFAMNRWW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/30/2013 04:14 AM, Dongxu Wang wrote: > Hi, >=20 > Now block layer does not check whether backing_file chain can be a > circle, do you think it is necessary to do a check? >=20 > For example, 1.qcow2's backing_file is 2.qcow2 and 2.qcow2's > backing_file is 1.qcow2, then any IO operation will be a fault. >=20 > If necessary, I will post a patch to fix. Yes, it's worth patching. >=20 > [$] qemu-img create -f qcow2 1.qcow2 > qemu-img: Image creation needs a size parameter > [$] qemu-img create -f qcow2 1.qcow2 8M > Formatting '1.qcow2', fmt=3Dqcow2 size=3D8388608 encryption=3Doff > cluster_size=3D65536 lazy_refcounts=3Doff > [$] qemu-img create -f qcow2 2.qcow2 -o backing_file=3D1.qcow2 > Formatting '2.qcow2', fmt=3Dqcow2 size=3D8388608 backing_file=3D'1.qcow= 2' > encryption=3Doff cluster_size=3D65536 lazy_refcounts=3Doff > [$] qemu-img create -f qcow2 1.qcow2 -o backing_file=3D2.qcow2 > Formatting '1.qcow2', fmt=3Dqcow2 size=3D8388608 backing_file=3D'2.qcow= 2' > encryption=3Doff cluster_size=3D65536 lazy_refcounts=3Doff > [$] qemu-io -c "read -v 0 512" 1.qcow2 > ^CSegmentation fault (core dumped) Also make sure that 'qemu-img info 1.qcow2' and 'qemu-img info --backing-chain 1.qcow2' don't crash. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2EMXDCFWFTXUEEFAMNRWW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRp0IQAAoJEKeha0olJ0NqBCcIAJkU9YH38a+FThJ7q6Ue421Y ByL5P4D39njgCGRJAA3+h5p1lMtyd6HuQvFW5TytPSW74L5/ZbrHQmly3gxwseiQ 2J7DvNNp/Rw1Tmik7UCTWg1BXj3s696fip3KwcdOZsN59f4RP5G4S84TBlmfuP71 7M/AYMfpOaSRnQrUdvoJEu9r0CpuDnsh5pJyy+njr9Mnk2G+HdknGz9O6K+xJmDJ 2koJYPgp3bV5ngapsYwSvj6cM0OCLzcD738jewjDu9kIH5H2RJg93UlFcaXD6G+V DB9Jyx1o8dtbr0sft8682LjDBVxJzbc5MmXwNFETzSWwO3rdupn9Xyxap3+Szb0= =6Sus -----END PGP SIGNATURE----- ------enig2EMXDCFWFTXUEEFAMNRWW--