Patchwork [1/1] block: fix block tray status

login
register
mail settings
Submitter Pavel Hrdina
Date Aug. 9, 2012, 10:44 a.m.
Message ID <df64e36c8fbd979d9cef621b41f2e935963ce4dc.1344508099.git.phrdina@redhat.com>
Download mbox | patch
Permalink /patch/176049/
State New
Headers show

Comments

Pavel Hrdina - Aug. 9, 2012, 10:44 a.m.
The tray status should change also if you eject empty block device.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Kevin Wolf - Sept. 4, 2012, 2:46 p.m.
Am 09.08.2012 12:44, schrieb Pavel Hrdina:
> The tray status should change also if you eject empty block device.
> 
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>

Thanks, applied to block-next.

Kevin

Patch

diff --git a/block.c b/block.c
index 24323c1..3d23507 100644
--- a/block.c
+++ b/block.c
@@ -897,10 +897,10 @@  void bdrv_close(BlockDriverState *bs)
             bdrv_delete(bs->file);
             bs->file = NULL;
         }
-
-        bdrv_dev_change_media_cb(bs, false);
     }
 
+    bdrv_dev_change_media_cb(bs, false);
+
     /*throttling disk I/O limits*/
     if (bs->io_limits_enabled) {
         bdrv_io_limits_disable(bs);