qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1] memory: call log_start after region_add


From: David Hildenbrand
Subject: Re: [Qemu-devel] [PATCH v1] memory: call log_start after region_add
Date: Mon, 16 Oct 2017 11:36:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 16.10.2017 11:18, David Hildenbrand wrote:
> It might be confusing for some listener implementations that implement
> both, region_add and log_start (e.g. KVM) if we call log_start before an
> actual region was added using region_add.
> 
> This makes current KVM code trigger an assertion
> ("kvm_section_update_flags: error finding slot"). So let's just reverse
> the order instead of tolerating log_start on yet unknown regions.
> 
> Reported-by: Thomas Huth <address@hidden>
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
>  memory.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/memory.c b/memory.c
> index 5e6351a6c1..f39b8592bf 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -2607,12 +2607,12 @@ static void listener_add_address_space(MemoryListener 
> *listener,
>              .offset_within_address_space = int128_get64(fr->addr.start),
>              .readonly = fr->readonly,
>          };
> -        if (fr->dirty_log_mask && listener->log_start) {
> -            listener->log_start(listener, &section, 0, fr->dirty_log_mask);
> -        }
>          if (listener->region_add) {
>              listener->region_add(listener, &section);
>          }
> +        if (fr->dirty_log_mask && listener->log_start) {
> +            listener->log_start(listener, &section, 0, fr->dirty_log_mask);
> +        }
>      }
>      if (listener->commit) {
>          listener->commit(listener);
> 

... deciding to tolerate it in KVM instead (just as it used to be), so
please ignore this patch.

-- 

Thanks,

David



reply via email to

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