From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFRv1-0007I1-Fh for qemu-devel@nongnu.org; Mon, 17 Feb 2014 12:23:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFRuw-0004Dx-K3 for qemu-devel@nongnu.org; Mon, 17 Feb 2014 12:23:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFRuw-0004DD-9h for qemu-devel@nongnu.org; Mon, 17 Feb 2014 12:23:42 -0500 Message-ID: <5302458F.8010104@redhat.com> Date: Mon, 17 Feb 2014 10:23:27 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392644839-20887-1-git-send-email-vincent.kherbache@inria.fr> <1392644839-20887-2-git-send-email-vincent.kherbache@inria.fr> In-Reply-To: <1392644839-20887-2-git-send-email-vincent.kherbache@inria.fr> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LRS115HGQnioRe9i5TLDQ8drdBoQ6TnMH" Subject: Re: [Qemu-devel] [PATCH] Properly check if 'log dirty' flags have changed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vincent KHERBACHE , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, gleb@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LRS115HGQnioRe9i5TLDQ8drdBoQ6TnMH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/17/2014 06:47 AM, Vincent KHERBACHE wrote: > The test (!!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) =3D=3D enable) is no= t > good because the condition is valid when enable =3D=3D 0 and current di= rty 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 cor= rectly > compare the memory flags (old/new). >=20 > Signed-off-by: Vincent KHERBACHE > --- > kvm-all.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) >=20 > + err =3D 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --LRS115HGQnioRe9i5TLDQ8drdBoQ6TnMH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTAkWPAAoJEKeha0olJ0Nq1ooH/1hABqw673+VlauVSagfHohf o+nsPwQ+g0cULO5XMv66tfQeMIYAbWGciIOtsj65C9MvAPcHmynRGkkSQz1QVhXk 7OXfCkTrM9yX9nYbikrTfemhqxff/uqpeAXNaefUGGG5gQAXePmTMA1xGiHzL0kL X+B7H+KHE6ds8laNjsnm1xhOtQxXAGVvTRXBng/SbYLN2Z2cFk5mtv4Agy5kzu8U YcXVRVXnKjCCNbNMx/rnZizQF51S4fqZ3vQRCZkFrBMFtpm2Qmydjo6DLaAPauYd aDJtL5vAYTXMeWTT68eWkwrX9m0V8K2ebl1KuYmen4DJaGvRDqRbQ+3LOMkNKc8= =hqnE -----END PGP SIGNATURE----- --LRS115HGQnioRe9i5TLDQ8drdBoQ6TnMH--