qcow2 is not necessarily the top layer node. Since bdrv_inactivate()
doesn't recurse, we should ensure all block nodes are inactivated.

Signed-off-by: Fam Zheng <f...@redhat.com>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index d4939b4..1c575e4 100644
--- a/block.c
+++ b/block.c
@@ -3270,7 +3270,7 @@ int bdrv_inactivate_all(void)
     BlockDriverState *bs = NULL;
     int ret;
 
-    while ((bs = bdrv_next(bs)) != NULL) {
+    while ((bs = bdrv_next_node(bs)) != NULL) {
         AioContext *aio_context = bdrv_get_aio_context(bs);
 
         aio_context_acquire(aio_context);
-- 
2.8.0


Reply via email to