From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFKFs-0003iv-RL for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:40:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFKFj-0004Y6-GP for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:40:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFKFj-0004Xw-8x for qemu-devel@nongnu.org; Fri, 30 Aug 2013 04:40:23 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7U8eMPA011120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 Aug 2013 04:40:22 -0400 From: Max Reitz Date: Fri, 30 Aug 2013 10:40:13 +0200 Message-Id: <1377852015-14762-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v3 0/2] qcow2: Snapshot update for zero clusters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz When creating a snapshots, the refcount adjustment function basically adjusted the refcounts of any cluster with a non-zero L2 entry. However, the L2 entry of unallocated zero clusters is exactly one (therefore non-zero) which led to wrong refcount updates on cluster 0 (the main qcow2 header), since the cluster index for these unallocated zero clusters is 0. This series fixes this by taking all cluster types specifically into account using qcow2_get_cluster_type and handling them accordingly. Furthermore, a short test is added. v3: - forgot 062.out in v2; now added v2: - more thorough commit message - take pre-allocated zero clusters into account - abort on unknown cluster type - a test case Max Reitz (2): qcow2-refcount: Snapshot update for zero clusters qemu-iotests: Snapshotting zero clusters block/qcow2-refcount.c | 52 +++++++++++++++++++++++++------------ tests/qemu-iotests/062 | 64 ++++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/062.out | 9 +++++++ tests/qemu-iotests/group | 1 + 4 files changed, 109 insertions(+), 17 deletions(-) create mode 100755 tests/qemu-iotests/062 create mode 100644 tests/qemu-iotests/062.out -- 1.8.3.1