diff mbox

blockdev: no need to drain+flush in hmp_drive_del

Message ID 1432822629-25401-1-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini May 28, 2015, 2:17 p.m. UTC
bdrv_close already does that, and in fact hmp_drive_del would need
another drain after the flush (which bdrv_close does).  So remove
the duplication.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 blockdev.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Alberto Garcia May 28, 2015, 2:21 p.m. UTC | #1
On Thu 28 May 2015 04:17:09 PM CEST, Paolo Bonzini <pbonzini@redhat.com> wrote:
> bdrv_close already does that, and in fact hmp_drive_del would need
> another drain after the flush (which bdrv_close does).  So remove
> the duplication.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto
Fam Zheng May 29, 2015, 1:45 a.m. UTC | #2
----- Original Message -----
> bdrv_close already does that, and in fact hmp_drive_del would need
> another drain after the flush (which bdrv_close does).  So remove
> the duplication.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Fam Zheng <famz@redhat.com>

> ---
>  blockdev.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/blockdev.c b/blockdev.c
> index 5eaf77e..d506a70 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -2143,9 +2143,6 @@ int hmp_drive_del(Monitor *mon, const QDict *qdict,
> QObject **ret_data)
>          return -1;
>      }
>  
> -    /* quiesce block driver; prevent further io */
> -    bdrv_drain_all();
> -    bdrv_flush(bs);
>      bdrv_close(bs);
>  
>      /* if we have a device attached to this BlockDriverState
> --
> 2.4.1
> 
> 
>
Stefan Hajnoczi May 29, 2015, 12:41 p.m. UTC | #3
On Thu, May 28, 2015 at 04:17:09PM +0200, Paolo Bonzini wrote:
> bdrv_close already does that, and in fact hmp_drive_del would need
> another drain after the flush (which bdrv_close does).  So remove
> the duplication.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  blockdev.c | 3 ---
>  1 file changed, 3 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Paolo Bonzini June 25, 2015, 12:18 p.m. UTC | #4
Ping?

Paolo

On 28/05/2015 16:17, Paolo Bonzini wrote:
> bdrv_close already does that, and in fact hmp_drive_del would need
> another drain after the flush (which bdrv_close does).  So remove
> the duplication.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  blockdev.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/blockdev.c b/blockdev.c
> index 5eaf77e..d506a70 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -2143,9 +2143,6 @@ int hmp_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
>          return -1;
>      }
>  
> -    /* quiesce block driver; prevent further io */
> -    bdrv_drain_all();
> -    bdrv_flush(bs);
>      bdrv_close(bs);
>  
>      /* if we have a device attached to this BlockDriverState
>
Stefan Hajnoczi June 26, 2015, 8:53 a.m. UTC | #5
On Thu, May 28, 2015 at 04:17:09PM +0200, Paolo Bonzini wrote:
> bdrv_close already does that, and in fact hmp_drive_del would need
> another drain after the flush (which bdrv_close does).  So remove
> the duplication.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  blockdev.c | 3 ---
>  1 file changed, 3 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan
diff mbox

Patch

diff --git a/blockdev.c b/blockdev.c
index 5eaf77e..d506a70 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2143,9 +2143,6 @@  int hmp_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
         return -1;
     }
 
-    /* quiesce block driver; prevent further io */
-    bdrv_drain_all();
-    bdrv_flush(bs);
     bdrv_close(bs);
 
     /* if we have a device attached to this BlockDriverState