From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAjtj-0001xN-6j for qemu-devel@nongnu.org; Fri, 25 Jul 2014 14:07:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAjtb-0005DF-O3 for qemu-devel@nongnu.org; Fri, 25 Jul 2014 14:07:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAjtb-0005Ct-F1 for qemu-devel@nongnu.org; Fri, 25 Jul 2014 14:07:07 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6PI75Bf002645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 25 Jul 2014 14:07:06 -0400 From: Max Reitz Date: Fri, 25 Jul 2014 20:07:37 +0200 Message-Id: <1406311665-2814-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 0/8] block/qcow2: Improve (?) zero cluster expansion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz The main purpose of this series is to add a progress report to qemu-img amend. This is achieved by adding a callback function to bdrv_amend_options() - the reasons for this choice are explained in patch 1. While adapting qcow2's expand_zero_clusters_in_l1() accordingly, I noticed a way to simplify it and get rid of the rather ugly bitmap used there (patch 6) and even found a way to optimize it (patch 7). However, Kevin already expressed strong dislike about that patch 7, as it complicates things in a function which should rarely ever be used. I personally don't have a strong opinion on the topic. The optimization should significantly increase the expansion performance; on the other hand, it makes the code equally more complicated. Patch 8 does not really depend on patch 7; it contains a test case specifically for patch 7, but of course it works without that patch just as well. Therefore, we can simply drop patch 7 if we don't need it. In this version, the total size of the "zero cluster expansion job" is the number of zero cluster entries in all L2 tables multiplied by the cluster size. This of course requires that number to be calculated beforehand, which is complicated as well. An easier way (suggested by Kevin) would be to simply use the number of all L2 entries as a basis. This would not be as exact, but much easier to implement. Since I already implemented the more complicated version of everything, I'm just sending it as-is. I'll write an alternative to patch 5 which uses the simpler variant and send it for comparison later. This series depends on v2 of my "qemu-img: Allow source cache mode specification" seires. Max Reitz (8): block: Add status callback to bdrv_amend_options() qemu-img: Add progress output for amend qemu-img: Fix insignifcant memleak block/qcow2: Make get_refcount() global block/qcow2: Implement status CB for amend block/qcow2: Simplify shared L2 handling in amend block/qcow2: Speed up zero cluster expansion iotests: Expand test 061 block.c | 5 +- block/qcow2-cluster.c | 319 ++++++++++++++++++++++++++++++++++----------- block/qcow2-refcount.c | 23 ++-- block/qcow2.c | 10 +- block/qcow2.h | 5 +- include/block/block.h | 5 +- include/block/block_int.h | 3 +- qemu-img.c | 30 ++++- tests/qemu-iotests/061 | 41 ++++++ tests/qemu-iotests/061.out | 40 ++++++ tests/qemu-iotests/group | 2 +- 11 files changed, 379 insertions(+), 104 deletions(-) -- 2.0.1