qed: convert to .bdrv_co_is_allocated()
The bdrv_qed_is_allocated() function is a synchronous wrapper aroundqed_find_cluster(), which performs the cluster lookup. In order toconvert the synchronous function to a coroutine function we yieldinstead of using qemu_aio_wait(). Note that QED's cache is already safe...
block: convert qcow2, qcow2, and vmdk to .bdrv_co_is_allocated()
The qcow2, qcow, and vmdk block drivers are based on coroutines. They have acoroutine mutex which protects internal state. We can convert the.bdrv_is_allocated() function to .bdrv_co_is_allocated() by holding the mutex...
qcow2: Cleanups and memleak fix in qcow2_snapshot_create
sn->id_str could be leaked before this. The rest of this patch changescomments, fixes coding style or removes checks that are unnecessary withg_malloc.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qcow2: Rework qcow2_snapshot_create error handling
Increase refcounts only after allocating a new L1 table has succeeded inorder 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....
qcow2: Return real error in qcow2_snapshot_goto
Besides fixing the return code, this adds some comments that make clearhow the code works and that it potentially breaks images if we fail inthe wrong place. Actually fixing this is left for the next patch....
qcow2: Fix order of refcount updates in qcow2_snapshot_goto
The refcount updates must be moved so that in the worst case we can getcluster leaks, but refcounts may never be too low.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qcow2: Fix order in qcow2_snapshot_delete
First the snapshot must be deleted and only then the refcounts can bedecreased.
qcow2: Fix error path in qcow2_snapshot_load_tmp
If the bdrv_read() of the snapshot's L1 table fails, return the righterror code and make sure that the old L1 table is still loaded and wedon't break the BlockDriverState completely.
block: use public bdrv_is_allocated() interface
There is no need for bdrv_commit() to use the BlockDriver.bdrv_is_allocated() interface directly. Converting to the publicinterface gives us the freedom to drop .bdrv_is_allocated() entirely infavor of a new .bdrv_co_is_allocated() in the future....
block: add .bdrv_co_is_allocated()
This patch adds the .bdrv_co_is_allocated() interface which is identicalto .bdrv_is_allocated() but runs in coroutine context. Running incoroutine context implies that other coroutines might be performing I/Oat the same time. Therefore it must be safe to run while the following...
View all revisions | View revisions
Also available in: Atom