blockdev: no need to drain in qmp_block_commit
PATCH 1/1 blockdev: no need to drain in qmp_block_commit
Draining is not necessary, I/O can happen as soon as the commit coroutine yields. Draining can be necessary before reopening the file for read/write, or while modifying the backing file chain, but that is done separately in bdrv_reopen_multiple or bdrv_close; this particular bdrv_drain_all does nothing for that.
--- blockdev.c | 3 --- 1 file changed, 3 deletions(-)
blockdev.c +0 -3
@@ -2355,9 +2355,6 @@ void qmp_block_commit(const char *device, aio_context =bdrv_get_aio_context (bs);aio_context_acquire (aio_context); -/* drain all i/o before commits */ -bdrv_drain_all (); -if (bdrv_op_is_blocked (bs,BLOCK_OP_TYPE_COMMIT_SOURCE , errp)) { goto out; }
Signature · 1 line
2.4.1
----- Original Message -----
Quoted 17 lines
Draining is not necessary, I/O can happen as soon as the commit coroutine yields. Draining can be necessary before reopening the file for read/write, or while modifying the backing file chain, but that is done separately in
bdrv_reopen_multipleorbdrv_close; this particularbdrv_drain_alldoes nothing for that.Signed-off-by Paolo Bonzini <[email protected]>--- blockdev.c | 3 --- 1 file changed, 3 deletions(-)blockdev.c +0
-0
blockdev.c void qmp_block_commit(const char *device, · line 2360
Quoted 6 lines
blockdev.c +0
-3@@ -2355,9 +2355,6 @@ void qmp_block_commit(const char *device, aio_context =bdrv_get_aio_context (bs);aio_context_acquire (aio_context); -/* drain all i/o before commits */ -bdrv_drain_all (); -
Quoted 8 lines
blockdev.c +0
-1if (bdrv_op_is_blocked (bs,BLOCK_OP_TYPE_COMMIT_SOURCE , errp)) { goto out; } --2.4.1
Quoted 11 lines · Paolo Bonzini
Draining is not necessary, I/O can happen as soon as the commit coroutine yields. Draining can be necessary before reopening the file for read/write, or while modifying the backing file chain, but that is done separately in
bdrv_reopen_multipleorbdrv_close; this particularbdrv_drain_alldoes nothing for that.Signed-off-by Paolo Bonzini <[email protected]>--- blockdev.c | 3 --- 1 file changed, 3 deletions(-)
Jeff Cody
AppliedQuoted 29 lines · Paolo Bonzini
Draining is not necessary, I/O can happen as soon as the commit coroutine yields. Draining can be necessary before reopening the file for read/write, or while modifying the backing file chain, but that is done separately in
bdrv_reopen_multipleorbdrv_close; this particularbdrv_drain_alldoes nothing for that.Signed-off-by Paolo Bonzini <[email protected]>--- blockdev.c | 3 --- 1 file changed, 3 deletions(-)blockdev.c +0
-3@@ -2355,9 +2355,6 @@ void qmp_block_commit(const char *device, aio_context =bdrv_get_aio_context (bs);aio_context_acquire (aio_context); -/* drain all i/o before commits */ -bdrv_drain_all (); -if (bdrv_op_is_blocked (bs,BLOCK_OP_TYPE_COMMIT_SOURCE , errp)) { goto out; }Signature · 1 line
2.4.1
Thanks, applied to my block tree:
https://github.com/codyprime/qemu-kvm-jtc/commits/block
-Jeff