diff options
author | Kevin Wolf <kwolf@redhat.com> | 2011-01-10 17:17:28 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-01-24 16:41:49 +0100 |
commit | 29c1a7301af752de6721e031d31faa48887204bd (patch) | |
tree | 9a094ebc84619f99d14166f596094042a3d358eb /block/qcow2-cache.c | |
parent | 493810940bfaad0fd5dd9bfb79cdc89519f89588 (diff) |
qcow2: Use QcowCache
Use the new functions of qcow2-cache.c for everything that works on refcount
block and L2 tables.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2-cache.c')
-rw-r--r-- | block/qcow2-cache.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index f7c4e2af0d..5f1740b9aa 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -104,6 +104,12 @@ static int qcow2_cache_entry_flush(BlockDriverState *bs, Qcow2Cache *c, int i) } } + if (c == s->refcount_block_cache) { + BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_UPDATE_PART); + } else if (c == s->l2_table_cache) { + BLKDBG_EVENT(bs->file, BLKDBG_L2_UPDATE); + } + ret = bdrv_pwrite(bs->file, c->entries[i].offset, c->entries[i].table, s->cluster_size); if (ret < 0) { @@ -218,6 +224,10 @@ static int qcow2_cache_do_get(BlockDriverState *bs, Qcow2Cache *c, c->entries[i].offset = 0; if (read_from_disk) { + if (c == s->l2_table_cache) { + BLKDBG_EVENT(bs->file, BLKDBG_L2_LOAD); + } + ret = bdrv_pread(bs->file, offset, c->entries[i].table, s->cluster_size); if (ret < 0) { return ret; |