Statistics
| Branch: | Revision:

root / block-qcow2.c @ 72249e34

History | View | Annotate | Download (81.7 kB)

# Date Author Comment
3ec88e80 02/06/2009 12:05 am aliguori

block: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6527 c046a42c-6fe2-441c-8c8c-71466251a162

1987530f 01/22/2009 08:57 pm aliguori

qcow2 format: keep 'num_free_bytes', and show it upon 'info blockstats' (Uri Lublin)

'num_free_bytes' is the number of non-allocated bytes below highest-allocation.
It's useful, together with the highest-allocation, to figure out how
fragmented the image is, and how likely it will run out-of-space soon....

c4218205 01/22/2009 08:57 pm aliguori

block-qcow2: export highest_allocated through BlockDriverInfo and get_info() (Uri Lublin)

Signed-off-by: Uri Lublin <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6405 c046a42c-6fe2-441c-8c8c-71466251a162

5d4cbd78 01/22/2009 08:57 pm aliguori

block-qcow2: keep highest allocated byte (Uri Lublin)

We want to know the highest written offset for qcow2 images.
This gives a pretty good (and easy to calculate) estimation to how
much more allocation can be done for the block device.

It can be usefull for allocating more diskspace for that image...

63c75dcd 01/17/2009 12:32 am malc

Avoid calling qemu_mallocz with zero size

Currently qemu_mallocz calls malloc and handling of zero by malloc is
implementation defined behaviour:
http://www.opengroup.org/onlinepubs/7990989775/xsh/malloc.html

malloc(0) on AIX returns NULL1 and qcow2 images without snapshots...

54c16572 01/08/2009 09:32 pm aliguori

qcow2: free old snapshots array upon creation of a new one (Uri Lublin)

Don't leak memory

Rebased for qemu tree.

Signed-off-by: Uri Lublin <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6245 c046a42c-6fe2-441c-8c8c-71466251a162

ff4b91c2 01/07/2009 07:22 pm aliguori

qcow2: Fix cluster allocation (Kevin Wolf)

When allocating multiple clusters at once, the qcow2 implementation
tries to find as many physically contiguous clusters as possible to
allow larger writes. This search includes allocated clusters which are
in the right place and still free clusters. If the range to allocate...

ab5ccbd6 01/07/2009 06:43 pm aliguori

Fix compressed qcow2 (Gleb Natapov)

Correctly calculate number of contiguous clusters.

Acked-by: Kevin Wolf <>
Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6212 c046a42c-6fe2-441c-8c8c-71466251a162

4dc822d7 12/04/2008 11:39 pm aliguori

Use writeback caching by default with qcow2

qcow2 writes a cluster reference count on every cluster update. This causes
performance to crater when using anything but cache=writeback. This is most
noticeable when using savevm. Right now, qcow2 isn't a reliable format...

e976c6a1 12/02/2008 10:14 pm aliguori

Change order of metadata update to prevent loosing guest data because of unexpected exit (Gleb Natapov)

Currently the order is this (during cow since it's the interesting case):
1. Decrement refcount of old clusters
2. Increment refcount for newly allocated clusters...

6db6c638 12/02/2008 10:11 pm aliguori

Cleanup {alloc|get}_cluster_offset() (Gleb Natapov)

Move duplicated code into helper functions.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5860 c046a42c-6fe2-441c-8c8c-71466251a162

643e5399 12/02/2008 10:10 pm aliguori

Write table offset and size in one syscall (Gleb Natapov)

Otherwise if VM is killed between two writes data may be lost.
But if offset and size fields are at the same disk block one
write should update them both simultaneously.

Signed-off-by: Gleb Natapov <>...

a32ef786 12/02/2008 10:08 pm aliguori

Introduce new helper function qcow_shedule_bh() (Gleb Natapov)

Use it to remove code duplications from qcow_aio_read_cb().

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5858 c046a42c-6fe2-441c-8c8c-71466251a162

ac674887 12/02/2008 10:06 pm aliguori

Remove tabs from qcow_aio_read_cb(). (Gleb Natapov)

Fix indentation.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5857 c046a42c-6fe2-441c-8c8c-71466251a162

1490791f 10/31/2008 07:28 pm aliguori

fix bdrv_aio_read API breakage in qcow2 (Andrea Arcangeli)

I noticed the qemu_aio_flush was doing nothing at all. And a flood of
cmd_writeb commands leading to a noop-invocation of qemu_aio_flush
were executed.

In short all 'memset;goto redo' places must be fixed to use the bh and...

f4af02ed 09/24/2008 07:52 pm aliguori

fix bug in block-qcow2.c:alloc_cluster_offset() (Shahar Frank)

During the debugging of the new revision of the zero dedup patch I
stepped on the following bug in block-qcow2.c:alloc_cluster_offset(). I
am not sure what the exact damage this bug can do, but it may be very...

ac509d88 09/16/2008 04:36 pm balrog

Move offsetof to osdep.h, remove local defintions.

With this container_of can actually be used without causing build errors.
Reformat container_of.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5234 c046a42c-6fe2-441c-8c8c-71466251a162

bc352085 08/14/2008 09:11 pm aliguori

qcow2: Try to aggregate free clusters and freed clusters (Laurent Vivier)

In alloc_cluster_offset(), try to aggregate free clusters and freed clusters.

Signed-off-by: Laurent Vivier <>
Signed-off-by: Anthony Liguori <>...

768706a5 08/14/2008 09:11 pm aliguori

qcow2: Make sure to return an error when L2 table loading fails

This was suggested by Kevin Wolf since this is, in fact, an error condition.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5007 c046a42c-6fe2-441c-8c8c-71466251a162

095a9c58 08/14/2008 09:10 pm aliguori

qcow2: Aggregate same type clusters (Laurent Vivier)

Modify get_cluster_offset(), alloc_cluster_offset() to specify how many clusters
we want.

Signed-off-by: Laurent Vivier <>
Signed-off-by: Anthony Liguori <>

...

52d893ec 08/14/2008 09:09 pm aliguori

Extract compressing part from alloc_cluster_offset() (Laurent Vivier)

Divide alloc_cluster_offset() into alloc_cluster_offset() and
alloc_compressed_cluster_offset().
Common parts are moved to free_any_clusters() and get_cluster_table();

Signed-off-by: Laurent Vivier <>...

05203524 08/14/2008 09:08 pm aliguori

Divide get_cluster_offset() (Laurent Vivier)

Divide get_cluster_offset() into get_cluster_offset() and
alloc_cluster_offset().

Signed-off-by: Laurent Vivier <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5004 c046a42c-6fe2-441c-8c8c-71466251a162

108534b9 08/14/2008 09:07 pm aliguori

qcow2: Extract code from get_cluster_offset() (Laurent Vivier)

Extract code from get_cluster_offset() into new functions:

- seek_l2_table()

Search an l2 offset in the l2_cache table.

- l2_load()

Read the l2 entry from disk

- l2_allocate()

Allocate a new l2 entry....

b5eff355 03/12/2008 01:30 am aurel32

Revert fix for CVE-2008-0928. Will be fixed in a different way later.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4041 c046a42c-6fe2-441c-8c8c-71466251a162

902b27d0 03/11/2008 07:17 pm aurel32

Fix CVE-2008-0928 - insufficient block device address range checking

Qemu 0.9.1 and earlier does not perform range checks for block device
read or write requests, which allows guest host users with root
privileges to access arbitrary memory and escape the virtual machine....

faf07963 11/11/2007 04:51 am pbrook

Split block API from vl.h.
Remove QEMU_TOOL. Replace with QEMU_IMG and NEED_CPU_H.
Avoid linking qemu-img against whole system emulatior.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3578 c046a42c-6fe2-441c-8c8c-71466251a162

3b46e624 09/17/2007 11:09 am ths

find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162

ec36ba14 09/17/2007 12:59 am ths

vmdk compatibility level 6 images, by Soren Hansen.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3175 c046a42c-6fe2-441c-8c8c-71466251a162

5fafdf24 09/17/2007 12:08 am ths

find -type f | xargs sed -i 's/[\t ]$//g' # on most files

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162

23be50f1 04/02/2007 03:48 pm ths

Qcow2: Release refcount table clusters after growing the refcount table,
by Juergen Keil.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2586 c046a42c-6fe2-441c-8c8c-71466251a162

a4080ece 04/01/2007 10:01 pm ths

Qcow2 corruption fix, by Juergen Keil.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2578 c046a42c-6fe2-441c-8c8c-71466251a162

ce1a14dc 08/07/2006 05:38 am pbrook

Dynamically allocate AIO Completion Blocks.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2098 c046a42c-6fe2-441c-8c8c-71466251a162

a9465922 08/06/2006 04:34 pm bellard

handle read outside the backing file

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2093 c046a42c-6fe2-441c-8c8c-71466251a162

15e6690a 08/06/2006 01:24 am bellard

fixed disk image creation

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2089 c046a42c-6fe2-441c-8c8c-71466251a162

585f8587 08/06/2006 12:14 am bellard

new qcow2 disk image format

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2083 c046a42c-6fe2-441c-8c8c-71466251a162