Statistics
| Branch: | Revision:

root / block / qcow2-refcount.c @ 2dedf83e

History | View | Annotate | Download (30 kB)

# Date Author Comment
f2b7c8b3 01/26/2010 10:59 pm Kevin Wolf

qcow2: Fix error handling in grow_refcount_table

Return the appropriate error code instead of -EIO.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

09508d13 01/26/2010 10:59 pm Kevin Wolf

qcow2: Improve error handling in update_refcount

If update_refcount fails, try to undo any changes made so far to avoid
inconsistencies in the image file.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

7322afe7 01/26/2010 10:59 pm Kevin Wolf

qcow2: Allow updating no refcounts

There's absolutely no problem with updating the refcounts of 0 clusters.
At least snapshot code is doing this and would fail once the result of
update_refcount isn't ignored any more.

Signed-off-by: Kevin Wolf <>...

db3a964f 01/26/2010 10:59 pm Kevin Wolf

qcow2: Don't ignore update_refcount return value

update_refcount can return errors that need to be handled by the callers.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

5d757b56 01/26/2010 10:59 pm Kevin Wolf

qcow2: Don't ignore qcow2_alloc_clusters return value

Now that qcow2_alloc_clusters can return error codes, we must handle them in
the callers of qcow2_alloc_clusters.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

f7dcfac0 01/14/2010 01:14 am Amit Shah

qcow2-refcount: remove dead assignment

clang-analyzer points out a redundant assignment.

Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

702ef63f 12/03/2009 07:45 pm Kevin Wolf

qcow2: Fix some more qemu_malloc fallout

Oh joy...

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

c5baaa48 10/27/2009 07:28 pm Kevin Wolf

qcow2: Fix grow_refcount_table error handling

In case of failure, we haven't increased the refcount for the newly allocated
cluster yet. Therefore we must not free the cluster or its refcount will become
negative (and endless recursion is possible).

Signed-off-by: Kevin Wolf <>...

80ee15a6 10/05/2009 05:32 pm Kevin Wolf

qcow2: Increase maximum cluster size to 2 MB

This patch increases the maximum qcow2 cluster size to 2 MB. Starting with 128k
clusters, L2 tables span 2 GB or more of virtual disk space, causing 32 bit
truncation and wraparound of signed integers. Therefore some variables need to...

0bf9e31a 07/20/2009 08:19 pm Blue Swirl

Fix most warnings (errors with -Werror) when debugging is enabled

I used the following command to enable debugging:
perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * /* *//*

Signed-off-by: Blue Swirl <>

3f6a3ee5 07/10/2009 09:44 pm Kevin Wolf

qcow2: Fix L1 table memory allocation

Contrary to what one could expect, the size of L1 tables is not cluster
aligned. So as we're writing whole sectors now instead of single entries,
we need to ensure that the L1 table in memory is large enough; otherwise...

3b88e52b 06/29/2009 10:18 pm Kevin Wolf

qcow2: Cache refcount blocks during snapshot creation

The really time consuming part of snapshotting is to adjust the reference count
of all clusters. Currently after each adjusted cluster the refcount block is
written to disk.

Don't write each single byte immediately to disk but cache all writes to the...

9923e05e 06/16/2009 11:18 pm Kevin Wolf

update_refcount: Write complete sectors

When updating the refcount blocks in update_refcount(), write complete sectors
instead of updating single entries.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

f7d0fe02 06/16/2009 11:18 pm Kevin Wolf

qcow2: Split out refcount handling

qcow2-refcount.c contains all functions which are related to cluster
allocation and management in the image file. A large part of this is the
reference counting of these clusters.

Also a header file qcow2.h is introduced which will contain the interface of...

45aba42f 06/16/2009 11:18 pm Kevin Wolf

qcow2: Split out guest cluster functions

qcow2-cluster.c contains all functions related to the management of guest
clusters, i.e. what the guest sees on its virtual disk. This code is about
mapping these guest clusters to host clusters in the image file using the...

ed6ccf0f 06/16/2009 11:18 pm Kevin Wolf

qcow2: Rename global functions

The qcow2 source is now split into several more manageable files. During the
conversion quite some functions that were static before needed to be changed to
be global to make the source compile again.

We were lucky enough not to get name conflicts with these additional global...