Skip to contentSkip to conversation

blockdev: no need to drain in qmp_block_commit

PATCH Applied Paolo Bonzini 4 participants 4 messages May 28, 2015 – Jun 16, 2015

lore
Share & tools
lore
#0 lore raw

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
index d506a70..aee0395 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw

----- 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_multiple or bdrv_close; this particular bdrv_drain_all does nothing for that.

---
 blockdev.c | 3 ---
 1 file changed, 3 deletions(-)
blockdev.c +0 -0
index d506a70..aee0395 100644

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 -1
     if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_COMMIT_SOURCE, errp)) {
         goto out;
     }
--

2.4.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini
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_multiple or bdrv_close; this particular bdrv_drain_all does nothing for that.

---
 blockdev.c | 3 ---
 1 file changed, 3 deletions(-)
Applied
#3 lore raw
In reply to Paolo Bonzini
Quoted 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_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
index d506a70..aee0395 100644
@@ -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