]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - blockdev.c
block: Mark bdrv_has_zero_init() and callers GRAPH_RDLOCK
[thirdparty/qemu.git] / blockdev.c
index e9b7e38dc41f6e77e9fb81ab940ebdb1a4351953..148df99e003f8bf62bda8dd3872ca92e5a3e4bd1 100644 (file)
@@ -3156,9 +3156,11 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
         return;
     }
 
+    bdrv_graph_rdlock_main_loop();
     zero_target = (arg->sync == MIRROR_SYNC_MODE_FULL &&
                    (arg->mode == NEW_IMAGE_MODE_EXISTING ||
                     !bdrv_has_zero_init(target_bs)));
+    bdrv_graph_rdunlock_main_loop();
 
 
     /* Honor bdrv_try_change_aio_context() context acquisition requirements. */