Statistics
| Branch: | Revision:

root / block @ f8a2e5e3

Name Size
blkdebug.c 12.7 kB
blkverify.c 10.2 kB
bochs.c 7 kB
cloop.c 5.8 kB
cow.c 9.3 kB
curl.c 16.3 kB
dmg.c 8.7 kB
iscsi.c 15.8 kB
nbd.c 7.6 kB
parallels.c 4.8 kB
qcow.c 26.5 kB
qcow2-cache.c 7.5 kB
qcow2-cluster.c 27 kB
qcow2-refcount.c 38.1 kB
qcow2-snapshot.c 17 kB
qcow2.c 38.4 kB
qcow2.h 7.8 kB
qed-check.c 5.4 kB
qed-cluster.c 5.1 kB
qed-gencb.c 688 Bytes
qed-l2-cache.c 5.4 kB
qed-table.c 8.7 kB
qed.c 43.8 kB
qed.h 10.6 kB
raw-posix-aio.h 1.3 kB
raw-posix.c 31.7 kB
raw-win32.c 11.6 kB
raw.c 3.4 kB
rbd.c 21.8 kB
sheepdog.c 53.7 kB
vdi.c 30.5 kB
vmdk.c 45.8 kB
vpc.c 19.5 kB
vvfat.c 81 kB

Latest revisions

# Date Author Comment
b7d5a5b8 12/05/2011 03:51 pm Stefan Hajnoczi

qed: convert to .bdrv_co_is_allocated()

The bdrv_qed_is_allocated() function is a synchronous wrapper around
qed_find_cluster(), which performs the cluster lookup. In order to
convert the synchronous function to a coroutine function we yield
instead of using qemu_aio_wait(). Note that QED's cache is already safe...

f8a2e5e3 12/05/2011 03:51 pm Stefan Hajnoczi

block: convert qcow2, qcow2, and vmdk to .bdrv_co_is_allocated()

The qcow2, qcow, and vmdk block drivers are based on coroutines. They have a
coroutine mutex which protects internal state. We can convert the
.bdrv_is_allocated() function to .bdrv_co_is_allocated() by holding the mutex...

d69969c4 12/05/2011 03:51 pm Kevin Wolf

qcow2: Update snapshot table information at once

Failing in the middle wouldn't help with the integrity of the image, so
doing everything in a single request seems better.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

03343166 12/05/2011 03:51 pm Kevin Wolf

qcow2: Cleanups and memleak fix in qcow2_snapshot_create

sn->id_str could be leaked before this. The rest of this patch changes
comments, fixes coding style or removes checks that are unnecessary with
g_malloc.

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

d1ea98d5 12/05/2011 03:51 pm Kevin Wolf

qcow2: Rework qcow2_snapshot_create error handling

Increase refcounts only after allocating a new L1 table has succeeded in
order to make leaks less likely. If writing the snapshot table fails,
revert in-memory state to be consistent with that on disk.

While at it, make it return the real error codes instead of -1....

589f284b 12/05/2011 03:51 pm Kevin Wolf

qcow2: Return real error in qcow2_snapshot_goto

Besides fixing the return code, this adds some comments that make clear
how the code works and that it potentially breaks images if we fail in
the wrong place. Actually fixing this is left for the next patch....

43a0cac4 12/05/2011 03:51 pm Kevin Wolf

qcow2: Fix order of refcount updates in qcow2_snapshot_goto

The refcount updates must be moved so that in the worst case we can get
cluster leaks, but refcounts may never be too low.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

9a476780 12/05/2011 03:51 pm Kevin Wolf

qcow2: Fix order in qcow2_snapshot_delete

First the snapshot must be deleted and only then the refcounts can be
decreased.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

e3f652b3 12/05/2011 03:51 pm Kevin Wolf

qcow2: Fix error path in qcow2_snapshot_load_tmp

If the bdrv_read() of the snapshot's L1 table fails, return the right
error code and make sure that the old L1 table is still loaded and we
don't break the BlockDriverState completely.

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

07fd8779 12/05/2011 03:51 pm Kevin Wolf

qcow2: Return real error code in qcow2_write_snapshots

Doesn't immediately fix anything as the callers don't use the return
value, but they will be fixed next.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

View revisions

Also available in: Atom