]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/backup.c
target/riscv: Allow debugger to access seed CSR
[mirror_qemu.git] / block / backup.c
index 824d39acaacdf6c46b81560ba5a271388f0eb948..db3791f4d16d5f45e880959f6e065b9c13539ced 100644 (file)
@@ -22,7 +22,6 @@
 #include "block/block-copy.h"
 #include "block/dirty-bitmap.h"
 #include "qapi/error.h"
-#include "qapi/qmp/qerror.h"
 #include "qemu/cutils.h"
 #include "sysemu/block-backend.h"
 #include "qemu/bitmap.h"
@@ -270,7 +269,10 @@ static int coroutine_fn backup_run(Job *job, Error **errp)
                 return -ECANCELED;
             }
 
+            /* rdlock protects the subsequent call to bdrv_is_allocated() */
+            bdrv_graph_co_rdlock();
             ret = block_copy_reset_unallocated(s->bcs, offset, &count);
+            bdrv_graph_co_rdunlock();
             if (ret < 0) {
                 return ret;
             }