aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block.c1
-rw-r--r--include/block/block-io.h8
-rw-r--r--include/block/block_int-common.h4
3 files changed, 9 insertions, 4 deletions
diff --git a/block.c b/block.c
index 1060194e8f..c4c67d09d4 100644
--- a/block.c
+++ b/block.c
@@ -740,6 +740,7 @@ int coroutine_fn bdrv_co_delete_file(BlockDriverState *bs, Error **errp)
IO_CODE();
assert(bs != NULL);
+ assert_bdrv_graph_readable();
if (!bs->drv) {
error_setg(errp, "Block node '%s' is not opened", bs->filename);
diff --git a/include/block/block-io.h b/include/block/block-io.h
index bf2748011e..a195a9fb11 100644
--- a/include/block/block-io.h
+++ b/include/block/block-io.h
@@ -90,8 +90,12 @@ int64_t co_wrapper bdrv_get_allocated_file_size(BlockDriverState *bs);
BlockMeasureInfo *bdrv_measure(BlockDriver *drv, QemuOpts *opts,
BlockDriverState *in_bs, Error **errp);
void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
-int coroutine_fn bdrv_co_delete_file(BlockDriverState *bs, Error **errp);
-void coroutine_fn bdrv_co_delete_file_noerr(BlockDriverState *bs);
+
+int coroutine_fn GRAPH_RDLOCK
+bdrv_co_delete_file(BlockDriverState *bs, Error **errp);
+
+void coroutine_fn GRAPH_RDLOCK
+bdrv_co_delete_file_noerr(BlockDriverState *bs);
/* async block I/O */
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index 88d9897c97..257a9d18c6 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -649,8 +649,8 @@ struct BlockDriver {
int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_flush)(BlockDriverState *bs);
/* Delete a created file. */
- int coroutine_fn (*bdrv_co_delete_file)(BlockDriverState *bs,
- Error **errp);
+ int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_delete_file)(
+ BlockDriverState *bs, Error **errp);
/*
* Flushes all data that was already written to the OS all the way down to