block: fix block tray status
authorPavel Hrdina <phrdina@redhat.com>
Thu, 9 Aug 2012 10:44:48 +0000 (12:44 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 12 Sep 2012 13:50:09 +0000 (15:50 +0200)
The tray status should change also if you eject empty block device.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c

diff --git a/block.c b/block.c
index 470bdcc..c754353 100644 (file)
--- 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);