>It's not clear to me why we need to introduce this field to stash >flags values. bs->open_flags already has this information.
>Originally this was introduced in 06d9260ffa9 ("qcow2: implement >bdrv_invalidate_cache (v2)") for qcow2. I wonder if that field is >necessary when we already have bs->open_flags. >What I don't like about s->flags is that it duplicates state *and* >it's done in each block driver that supports .bdrv_invalidate_cache(). > So I wonder if we can drop it? I added this flag after seeing the following code in in bdrv_open_common. /* * Clear flags that are internal to the block layer before opening the * image. */ open_flags = flags & ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING); This lead me to believe that bs->open_flags != open_flags.