From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhzsE-0004zE-KQ for qemu-devel@nongnu.org; Thu, 30 May 2013 06:14:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhzsA-0003Th-07 for qemu-devel@nongnu.org; Thu, 30 May 2013 06:14:22 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:42567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uhzs9-0003TT-SE for qemu-devel@nongnu.org; Thu, 30 May 2013 06:14:17 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 May 2013 06:14:16 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id D23F0C9003E for ; Thu, 30 May 2013 06:14:12 -0400 (EDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4UAEDNn326148 for ; Thu, 30 May 2013 06:14:13 -0400 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4UAHIVM016950 for ; Thu, 30 May 2013 04:17:18 -0600 Message-ID: <51A72673.7090300@linux.vnet.ibm.com> Date: Thu, 30 May 2013 18:14:11 +0800 From: Dongxu Wang MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC] Check backing_file chain's loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "kwolf@redhat.com" , stefanha@redhat.com Hi, Now block layer does not check whether backing_file chain can be a circle, do you think it is necessary to do a check? 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. If necessary, I will post a patch to fix. [$] 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=qcow2 size=8388608 encryption=off cluster_size=65536 lazy_refcounts=off [$] qemu-img create -f qcow2 2.qcow2 -o backing_file=1.qcow2 Formatting '2.qcow2', fmt=qcow2 size=8388608 backing_file='1.qcow2' encryption=off cluster_size=65536 lazy_refcounts=off [$] qemu-img create -f qcow2 1.qcow2 -o backing_file=2.qcow2 Formatting '1.qcow2', fmt=qcow2 size=8388608 backing_file='2.qcow2' encryption=off cluster_size=65536 lazy_refcounts=off [$] qemu-io -c "read -v 0 512" 1.qcow2 ^CSegmentation fault (core dumped) Thanks.