#
02c4f26b |
| 19-Aug-2014 |
Markus Armbruster <armbru@redhat.com> |
block: Use g_new() & friends to avoid multiplying sizes
g_new(T, n) is safer than g_malloc(sizeof(*v) * n) for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * ra
block: Use g_new() & friends to avoid multiplying sizes
g_new(T, n) is safer than g_malloc(sizeof(*v) * n) for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors.
Perhaps a conversion to g_malloc_n() would be neater in places, but that's merely four years old, and we can't use such newfangled stuff.
This commit only touches allocations with size arguments of the form sizeof(T), plus two that use 4 instead of sizeof(uint32_t). We can make the others safe by converting to g_malloc_n() when it becomes available to us in a couple of years.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
Revision tags: v2.0.2, v2.0.1, v2.1.0, v2.1.0-rc5, v2.1.0-rc4, v2.1.0-rc3, v1.7.2, v2.1.0-rc2, v2.1.0-rc1, v2.1.0-rc0 |
|
#
de82815d |
| 20-May-2014 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Handle failure for potentially large allocations
Some code in the block layer makes potentially huge allocations. Failure is not completely unexpected there, so avoid aborting qemu and handle
qcow2: Handle failure for potentially large allocations
Some code in the block layer makes potentially huge allocations. Failure is not completely unexpected there, so avoid aborting qemu and handle out-of-memory situations gracefully.
This patch addresses the allocations in the qcow2 block driver.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
Revision tags: v2.0.0, v2.0.0-rc3, v2.0.0-rc2, v2.0.0-rc1, v2.0.0-rc0, v1.7.1, v1.6.2, v1.7.0, v1.7.0-rc2, v1.7.0-rc1, v1.7.0-rc0 |
|
#
231bb267 |
| 10-Oct-2013 |
Max Reitz <mreitz@redhat.com> |
qcow2: Use negated overflow check mask
In qcow2_check_metadata_overlap and qcow2_pre_write_overlap_check, change the parameter signifying the checks to perform from its current positive form to a ne
qcow2: Use negated overflow check mask
In qcow2_check_metadata_overlap and qcow2_pre_write_overlap_check, change the parameter signifying the checks to perform from its current positive form to a negative one, i.e., it will no longer explicitly specify every check to perform but rather a mask of checks not to perform.
Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
Revision tags: v1.6.1 |
|
#
e7108fea |
| 03-Sep-2013 |
Max Reitz <mreitz@redhat.com> |
qcow2-cache: Empty cache
Add a function for emptying a cache, i.e., flushing it and marking all elements invalid.
Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redha
qcow2-cache: Empty cache
Add a function for emptying a cache, i.e., flushing it and marking all elements invalid.
Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
#
cf93980e |
| 30-Aug-2013 |
Max Reitz <mreitz@redhat.com> |
qcow2: Employ metadata overlap checks
The pre-write overlap check function is now called before most of the qcow2 writes (aborting it on collision or other error).
Signed-off-by: Max Reitz <mreitz@
qcow2: Employ metadata overlap checks
The pre-write overlap check function is now called before most of the qcow2 writes (aborting it on collision or other error).
Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
Revision tags: v1.5.3, v1.6.0, v1.6.0-rc3, v1.6.0-rc2, v1.6.0-rc1, v1.6.0-rc0, v1.5.2, v1.5.1, v1.4.2, v1.5.0, v1.5.0-rc3, v1.5.0-rc2, v1.5.0-rc1, v1.5.0-rc0, v1.4.1, v1.4.0, v1.4.0-rc2, v1.4.0-rc1, v1.4.0-rc0, v1.3.1 |
|
#
737e150e |
| 17-Dec-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
block: move include files to include/block/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
Revision tags: v1.2.2, v1.3.0, v1.3.0-rc2, v1.3.0-rc1, v1.3.0-rc0, v1.2.1, v1.1.2, v1.2.0, v1.2.0-rc3, v1.2.0-rc2, v1.2.0-rc1, v1.2.0-rc0, v1.1.1 |
|
#
6af4e9ea |
| 05-Jun-2012 |
Paolo Bonzini <pbonzini@redhat.com> |
qcow2: always operate caches in writeback mode
Writethrough does not need special-casing anymore in the qcow2 caches. The block layer adds flushes after every guest-initiated data write, and these w
qcow2: always operate caches in writeback mode
Writethrough does not need special-casing anymore in the qcow2 caches. The block layer adds flushes after every guest-initiated data write, and these will also flush the qcow2 caches to the OS.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
Revision tags: v1.1.0, v1.1.0-rc4, v1.1.0-rc3, v1.1-rc2, v1.1.0-rc2, v1.1-rc1, v1.1-rc0 |
|
#
3cce16f4 |
| 01-Mar-2012 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Add some tracing
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
|
Revision tags: v1.0.1, v1.0, v1.0-rc4, v1.0-rc3, v1.0-rc2, v1.0-rc1, v1.0-rc0, v0.15.1 |
|
#
7267c094 |
| 21-Aug-2011 |
Anthony Liguori <aliguori@us.ibm.com> |
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
Revision tags: v0.15.0, v0.15.0-rc2, v0.15.0-rc1, v0.15.0-rc0 |
|
#
93913dfd |
| 19-Jul-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Use Qcow2Cache in writeback mode during loadvm/savevm
In snapshotting there is no guest involved, so we can safely use a writeback mode and do the flushes in the right place (i.e. at the very
qcow2: Use Qcow2Cache in writeback mode during loadvm/savevm
In snapshotting there is no guest involved, so we can safely use a writeback mode and do the flushes in the right place (i.e. at the very end). This improves the time that creating/restoring an internal snapshot takes with an image in writethrough mode.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
Revision tags: v0.14.1, v0.14.0, v0.14.0-rc2, v0.14.0-rc1, v0.14.0-rc0 |
|
#
bf595021 |
| 27-Jan-2011 |
Jes Sorensen <Jes.Sorensen@redhat.com> |
Reorganize struct Qcow2Cache for better struct packing
Move size after the two pointers in struct Qcow2Cache to get better packing of struct elements on 64 bit architectures.
Signed-off-by: Jes Sor
Reorganize struct Qcow2Cache for better struct packing
Move size after the two pointers in struct Qcow2Cache to get better packing of struct elements on 64 bit architectures.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
#
3de0a294 |
| 14-Jan-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Batch flushes for COW
qcow2 calls bdrv_flush() after performing COW in order to ensure that the L2 table change is never written before the copy is safe on disk. Now that the L2 table is cach
qcow2: Batch flushes for COW
qcow2 calls bdrv_flush() after performing COW in order to ensure that the L2 table change is never written before the copy is safe on disk. Now that the L2 table is cached, we can wait with flushing until we write out the next L2 table.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
#
29c1a730 |
| 10-Jan-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Use QcowCache
Use the new functions of qcow2-cache.c for everything that works on refcount block and L2 tables.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
#
49381094 |
| 10-Jan-2011 |
Kevin Wolf <kwolf@redhat.com> |
qcow2: Add QcowCache
This adds some new cache functions to qcow2 which can be used for caching refcount blocks and L2 tables. When used with cache=writethrough they work like the old caching code wh
qcow2: Add QcowCache
This adds some new cache functions to qcow2 which can be used for caching refcount blocks and L2 tables. When used with cache=writethrough they work like the old caching code which is spread all over qcow2, so for this case we have merely a cleanup.
The interesting case is with writeback caching (this includes cache=none) where data isn't written to disk immediately but only kept in cache initially. This leads to some form of metadata write batching which avoids the current "write to refcount block, flush, write to L2 table" pattern for each single request when a lot of cluster allocations happen. Instead, cache entries are only written out if its required to maintain the right order. In the pure cluster allocation case this means that all metadata updates for requests are done in memory initially and on sync, first the refcount blocks are written to disk, then fsync, then L2 tables.
This improves performance of scenarios with lots of cluster allocations noticably (e.g. installation or after taking a snapshot).
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|