diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-01-21 17:09:43 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-01-25 18:18:33 +0100 |
commit | b812f6719c21921a819709098dc018ed151c999b (patch) | |
tree | 7ba53b619b76a1faff44994b59d069c0d57ccd9d /trace-events | |
parent | 343bded4ecfc467012e2ab675da75749f1d90f70 (diff) | |
download | qemu-b812f6719c21921a819709098dc018ed151c999b.zip qemu-b812f6719c21921a819709098dc018ed151c999b.tar.gz qemu-b812f6719c21921a819709098dc018ed151c999b.tar.bz2 |
mirror: perform COW if the cluster size is bigger than the granularity
When mirroring runs, the backing files for the target may not yet be
ready. However, this means that a copy-on-write operation on the target
would fill the missing sectors with zeros. Copy-on-write only happens
if the granularity of the dirty bitmap is smaller than the cluster size
(and only for clusters that are allocated in the source after the job
has started copying). So far, the granularity was fixed to 1MB; to avoid
the problem we detected the situation and required the backing files to
be available in that case only.
However, we want to lower the granularity for efficiency, so we need
a better solution. The solution is to always copy a whole cluster the
first time it is touched. The code keeps a bitmap of clusters that
have already been allocated by the mirroring job, and only does "manual"
copy-on-write if the chunk being copied is zero in the bitmap.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'trace-events')
-rw-r--r-- | trace-events | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/trace-events b/trace-events index 61ed349..ffa2756 100644 --- a/trace-events +++ b/trace-events @@ -84,6 +84,7 @@ mirror_before_flush(void *s) "s %p" mirror_before_drain(void *s, int64_t cnt) "s %p dirty count %"PRId64 mirror_before_sleep(void *s, int64_t cnt, int synced) "s %p dirty count %"PRId64" synced %d" mirror_one_iteration(void *s, int64_t sector_num, int nb_sectors) "s %p sector_num %"PRId64" nb_sectors %d" +mirror_cow(void *s, int64_t sector_num) "s %p sector_num %"PRId64 # blockdev.c qmp_block_job_cancel(void *job) "job %p" |