Skip to contentSkip to conversation

blockdev: no need to drain+flush in hmp_drive_del

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blockdev: no need to drain+flush in hmp_drive_del

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.

---
 blockdev.c | 3 ---
 1 file changed, 3 deletions(-)
blockdev.c +0 -3
index 5eaf77e..d506a70 100644
@@ -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
Signature · 1 line
2.4.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini

----- Original Message -----

Quoted 5 lines

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.

Quoted 24 lines
---
 blockdev.c | 3 ---
 1 file changed, 3 deletions(-)
blockdev.c +0 -3
index 5eaf77e..d506a70 100644
@@ -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

#4 lore raw
In reply to Paolo Bonzini

Ping?

Paolo

Quoted 24 lines · Paolo Bonzini

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.

---
 blockdev.c | 3 ---
 1 file changed, 3 deletions(-)
blockdev.c +0 -3
index 5eaf77e..d506a70 100644
@@ -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