]> git.proxmox.com Git - mirror_qemu.git/blobdiff - qemu-io-cmds.c
job: Move defer_to_main_loop to Job
[mirror_qemu.git] / qemu-io-cmds.c
index de8e3de72690d2ce299f98efd2347a56b5e698c2..9b3cd00af6c6094d7c367797bb1972d0dd47dde6 100644 (file)
@@ -17,6 +17,7 @@
 #include "block/qapi.h"
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
+#include "qemu/option.h"
 #include "qemu/timer.h"
 #include "qemu/cutils.h"
 
@@ -2013,8 +2014,11 @@ static int reopen_f(BlockBackend *blk, int argc, char **argv)
     opts = qopts ? qemu_opts_to_qdict(qopts, NULL) : NULL;
     qemu_opts_reset(&reopen_opts);
 
+    bdrv_subtree_drained_begin(bs);
     brq = bdrv_reopen_queue(NULL, bs, opts, flags);
     bdrv_reopen_multiple(bdrv_get_aio_context(bs), brq, &local_err);
+    bdrv_subtree_drained_end(bs);
+
     if (local_err) {
         error_report_err(local_err);
     } else {