12.03.2021 21:15, Max Reitz wrote:
@@ -1834,6 +1835,10 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, s->inflight_writes_counters = g_hash_table_new_full(g_int64_hash, g_int64_equal, g_free, g_free); + if (!has_data_file(bs) && (bs->file->bs->open_flags & BDRV_O_NOCACHE)) {Looks a bit like a layering violation, but I have no better proposal and you gave your reasoning, so, OK.
Probably better is check request_alignment of bs->file->bs. If it > 1 then enable the cache. -- Best regards, Vladimir
