qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Properly check if 'log dirty' flags have change


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] Properly check if 'log dirty' flags have changed
Date: Mon, 17 Feb 2014 10:23:27 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 02/17/2014 06:47 AM, Vincent KHERBACHE wrote:
> The test (!!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) == enable) is not
> good because the condition is valid when enable == 0 and current dirty log
> memory flag is set.
> As a consequence kvm_log_global_stop() does not stop the KVM dirty log
> tracking: kvm_set_migration_log(0) didn't do its job.
> So instead I propose to use kvm_slot_dirty_pages_log_change() which correctly
> compare the memory flags (old/new).
> 
> Signed-off-by: Vincent KHERBACHE <address@hidden>
> ---
>  kvm-all.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 

> +        err = kvm_slot_dirty_pages_log_change(mem, (bool)enable);

Casting to bool looks odd.  We already require a compliant C99 compiler,
which means the compiler already properly handles the squashing of all
non-zero values to true when calling a function with a parameter
prototyped as bool, without needing the cast.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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