@@ -641,7 +641,7 @@ static inline void set_l2_bitmap(BDRVQcow2State *s, uint64_t *l2_slice,
641641 l2_slice [idx + 1 ] = cpu_to_be64 (bitmap );
642642}
643643
644- static inline bool has_data_file (BlockDriverState * bs )
644+ static inline bool GRAPH_RDLOCK has_data_file (BlockDriverState * bs )
645645{
646646 BDRVQcow2State * s = bs -> opaque ;
647647 return (s -> data_file != bs -> file );
@@ -709,8 +709,8 @@ static inline int64_t qcow2_vm_state_offset(BDRVQcow2State *s)
709709 return (int64_t )s -> l1_vm_state_index << (s -> cluster_bits + s -> l2_bits );
710710}
711711
712- static inline QCow2ClusterType qcow2_get_cluster_type ( BlockDriverState * bs ,
713- uint64_t l2_entry )
712+ static inline QCow2ClusterType GRAPH_RDLOCK
713+ qcow2_get_cluster_type ( BlockDriverState * bs , uint64_t l2_entry )
714714{
715715 BDRVQcow2State * s = bs -> opaque ;
716716
@@ -743,7 +743,7 @@ static inline QCow2ClusterType qcow2_get_cluster_type(BlockDriverState *bs,
743743 * (this checks the whole entry and bitmap, not only the bits related
744744 * to subcluster @sc_index).
745745 */
746- static inline
746+ static inline GRAPH_RDLOCK
747747QCow2SubclusterType qcow2_get_subcluster_type (BlockDriverState * bs ,
748748 uint64_t l2_entry ,
749749 uint64_t l2_bitmap ,
@@ -834,9 +834,9 @@ int64_t qcow2_refcount_metadata_size(int64_t clusters, size_t cluster_size,
834834 int refcount_order , bool generous_increase ,
835835 uint64_t * refblock_count );
836836
837- int qcow2_mark_dirty (BlockDriverState * bs );
838- int qcow2_mark_corrupt (BlockDriverState * bs );
839- int qcow2_update_header (BlockDriverState * bs );
837+ int GRAPH_RDLOCK qcow2_mark_dirty (BlockDriverState * bs );
838+ int GRAPH_RDLOCK qcow2_mark_corrupt (BlockDriverState * bs );
839+ int GRAPH_RDLOCK qcow2_update_header (BlockDriverState * bs );
840840
841841void GRAPH_RDLOCK
842842qcow2_signal_corruption (BlockDriverState * bs , bool fatal , int64_t offset ,
@@ -890,10 +890,11 @@ int GRAPH_RDLOCK qcow2_write_caches(BlockDriverState *bs);
890890int coroutine_fn qcow2_check_refcounts (BlockDriverState * bs , BdrvCheckResult * res ,
891891 BdrvCheckMode fix );
892892
893- void qcow2_process_discards (BlockDriverState * bs , int ret );
893+ void GRAPH_RDLOCK qcow2_process_discards (BlockDriverState * bs , int ret );
894894
895- int qcow2_check_metadata_overlap (BlockDriverState * bs , int ign , int64_t offset ,
896- int64_t size );
895+ int GRAPH_RDLOCK
896+ qcow2_check_metadata_overlap (BlockDriverState * bs , int ign , int64_t offset ,
897+ int64_t size );
897898int GRAPH_RDLOCK
898899qcow2_pre_write_overlap_check (BlockDriverState * bs , int ign , int64_t offset ,
899900 int64_t size , bool data_file );
@@ -939,8 +940,9 @@ qcow2_alloc_host_offset(BlockDriverState *bs, uint64_t offset,
939940int coroutine_fn GRAPH_RDLOCK
940941qcow2_alloc_compressed_cluster_offset (BlockDriverState * bs , uint64_t offset ,
941942 int compressed_size , uint64_t * host_offset );
942- void qcow2_parse_compressed_l2_entry (BlockDriverState * bs , uint64_t l2_entry ,
943- uint64_t * coffset , int * csize );
943+ void GRAPH_RDLOCK
944+ qcow2_parse_compressed_l2_entry (BlockDriverState * bs , uint64_t l2_entry ,
945+ uint64_t * coffset , int * csize );
944946
945947int coroutine_fn GRAPH_RDLOCK
946948qcow2_alloc_cluster_link_l2 (BlockDriverState * bs , QCowL2Meta * m );
@@ -993,8 +995,9 @@ qcow2_check_fix_snapshot_table(BlockDriverState *bs, BdrvCheckResult *result,
993995 BdrvCheckMode fix );
994996
995997/* qcow2-cache.c functions */
996- Qcow2Cache * qcow2_cache_create (BlockDriverState * bs , int num_tables ,
997- unsigned table_size );
998+ Qcow2Cache * GRAPH_RDLOCK
999+ qcow2_cache_create (BlockDriverState * bs , int num_tables , unsigned table_size );
1000+
9981001int qcow2_cache_destroy (Qcow2Cache * c );
9991002
10001003void qcow2_cache_entry_mark_dirty (Qcow2Cache * c , void * table );
@@ -1020,17 +1023,24 @@ void *qcow2_cache_is_table_offset(Qcow2Cache *c, uint64_t offset);
10201023void qcow2_cache_discard (Qcow2Cache * c , void * table );
10211024
10221025/* qcow2-bitmap.c functions */
1023- int coroutine_fn
1026+ int coroutine_fn GRAPH_RDLOCK
10241027qcow2_check_bitmaps_refcounts (BlockDriverState * bs , BdrvCheckResult * res ,
10251028 void * * refcount_table ,
10261029 int64_t * refcount_table_size );
1030+
10271031bool coroutine_fn GRAPH_RDLOCK
1028- qcow2_load_dirty_bitmaps (BlockDriverState * bs , bool * header_updated , Error * * errp );
1029- bool qcow2_get_bitmap_info_list (BlockDriverState * bs ,
1030- Qcow2BitmapInfoList * * info_list , Error * * errp );
1032+ qcow2_load_dirty_bitmaps (BlockDriverState * bs , bool * header_updated ,
1033+ Error * * errp );
1034+
1035+ bool GRAPH_RDLOCK
1036+ qcow2_get_bitmap_info_list (BlockDriverState * bs ,
1037+ Qcow2BitmapInfoList * * info_list , Error * * errp );
1038+
10311039int GRAPH_RDLOCK qcow2_reopen_bitmaps_rw (BlockDriverState * bs , Error * * errp );
10321040int GRAPH_RDLOCK qcow2_reopen_bitmaps_ro (BlockDriverState * bs , Error * * errp );
1033- int coroutine_fn qcow2_truncate_bitmaps_check (BlockDriverState * bs , Error * * errp );
1041+
1042+ int coroutine_fn GRAPH_RDLOCK
1043+ qcow2_truncate_bitmaps_check (BlockDriverState * bs , Error * * errp );
10341044
10351045bool GRAPH_RDLOCK
10361046qcow2_store_persistent_dirty_bitmaps (BlockDriverState * bs , bool release_stored ,
0 commit comments