qemu-devel
[Top][All Lists]
Advanced

[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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 11/29] memory: include DIRTY_MEMORY_MIGRATION in the dirty log mask
Date: Tue, 26 May 2015 11:26:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


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).

Does this make sense?

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]