qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vincent KHERBACHE <vincent.kherbache@inria.fr>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, gleb@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Properly check if 'log dirty' flags have changed
Date: Mon, 17 Feb 2014 10:23:27 -0700	[thread overview]
Message-ID: <5302458F.8010104@redhat.com> (raw)
In-Reply-To: <1392644839-20887-2-git-send-email-vincent.kherbache@inria.fr>

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

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 <vincent.kherbache@inria.fr>
> ---
>  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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

      reply	other threads:[~2014-02-17 17:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-17 13:47 [Qemu-devel] [PATCH] dirty log: fix kvm_set_migration_log() behavior Vincent KHERBACHE
2014-02-17 13:47 ` [Qemu-devel] [PATCH] Properly check if 'log dirty' flags have changed Vincent KHERBACHE
2014-02-17 17:23   ` Eric Blake [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5302458F.8010104@redhat.com \
    --to=eblake@redhat.com \
    --cc=gleb@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vincent.kherbache@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).