[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/29] memory: include DIRTY_MEMORY_MIGRATION in
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH 11/29] memory: include DIRTY_MEMORY_MIGRATION in the dirty log mask |
Date: |
Tue, 26 May 2015 17:48:37 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, 05/26 11:26, Paolo Bonzini wrote:
>
>
> On 26/05/2015 11:22, Fam Zheng wrote:
> >>>> > > > @@ -1329,7 +1329,11 @@ bool
> >>>> > > > memory_region_is_skip_dump(MemoryRegion *mr)
> >>>> > > >
> >>>> > > > uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr)
> >>>> > > > {
> >>>> > > > - return mr->dirty_log_mask;
> >>>> > > > + uint8_t mask = mr->dirty_log_mask;
> >>>> > > > + if (global_dirty_log) {
> >>>> > > > + mask |= (1 << DIRTY_MEMORY_MIGRATION);
> >>> > >
> >>> > > This is ugly, but I don't know how to do differently. :(
> >> >
> >> > Why do you think it's ugly?
> >> > As long as the log_start/log_stop callbacks
> >> > are handled properly, I think it's okay.
> > Ugly in the per object function relying on a global to propogate the new
> > value.
>
> Yes, but that's the point of the patch. :) It lets the listeners track
> updates to the local state of the MemoryRegion instead of having to
> track the global state. So it's somewhat ugly, but it is less ugly than
> tracking exactly the same global state in exec.c (core_log_global_start)
> and kvm-all.c (kvm_log_global_start).
Truely it's less ugly :)
>
> Does this make sense?
Yes. Thanks.
Fam