From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSTFg-0005tz-IR for qemu-devel@nongnu.org; Mon, 02 Mar 2015 11:31:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSTFd-0004JJ-1P for qemu-devel@nongnu.org; Mon, 02 Mar 2015 11:31:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSTFc-0004IM-Oy for qemu-devel@nongnu.org; Mon, 02 Mar 2015 11:31:24 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t22GVO6p003187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 2 Mar 2015 11:31:24 -0500 Message-ID: <54F4905A.8050601@redhat.com> Date: Mon, 02 Mar 2015 11:31:22 -0500 From: Max Reitz MIME-Version: 1.0 References: <1417798412-15330-1-git-send-email-mreitz@redhat.com> <5481EEB7.9030308@redhat.com> In-Reply-To: <5481EEB7.9030308@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] iotests: Test non-self-referential qcow2 refblocks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi On 2014-12-05 at 12:43, Eric Blake wrote: > On 12/05/2014 09:53 AM, Max Reitz wrote: >> It is easy to create only self-referential refblocks, but there are >> cases where that is impossible. This adds a test for two of those cases >> (combined in a single test case). >> >> Suggested-by: Eric Blake >> Signed-off-by: Max Reitz >> --- >> This patch depends on version 4 (or hopefully any later version) of my >> "qcow2: Support refcount orders != 4" series. >> --- >> tests/qemu-iotests/115 | 95 ++++++++++++++++++++++++++++++++++++++++++++++ >> tests/qemu-iotests/115.out | 8 ++++ >> tests/qemu-iotests/group | 1 + >> 3 files changed, 104 insertions(+) >> create mode 100755 tests/qemu-iotests/115 >> create mode 100644 tests/qemu-iotests/115.out >> + >> +# One refblock can describe (with cluster_size=512 and refcount_bits=64) >> +# 512/8 = 64 clusters, therefore the L1 table should cover 128 clusters, which >> +# equals 128 * (512/8) = 8192 entries (actually, 8192 - 512/8 = 8129 would > This math is slightly off; you really only need 127 consecutive clusters > to guarantee that you have an aligned 64 clusters somewhere in the mix. > Also, 8192 - 512/8 = 8128 (you are missing the +1 L2 entry that is > necessary to ensure the rollover to 128 clusters). The real minimum of > L2 entries to provoke the situation we are after is thus 127 * (512/8) - > 512/8 + 1 = 8065... > >> +# suffice, but it does not really matter). 8192 L2 tables can in turn describe > ...at any rate, your conclusion that it does not really matter is > correct; and rounding up to the actual power of 2 is both easier to > explain and more likely to happen in practice (I'm not going to go out > of my way to create a 255.9M guest image, after all). > > So, whether or not you want to tweak the comment wording, the test > itself is correct. Once again, I'm super-fast with my responses. You're right. However, since the wording is not "This is the minimum for getting a non-self-referential refblock" but more like "If we do this, we are sure to get a non-self-referential refblock", I'll just leave it as it is. > Reviewed-by: Eric Blake Thanks!