From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNUyV-0003lC-62 for qemu-devel@nongnu.org; Mon, 16 Feb 2015 18:21:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNUyS-0001mt-09 for qemu-devel@nongnu.org; Mon, 16 Feb 2015 18:21:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNUyR-0001mh-P4 for qemu-devel@nongnu.org; Mon, 16 Feb 2015 18:21:07 -0500 Message-ID: <54E27B59.5040702@redhat.com> Date: Mon, 16 Feb 2015 16:20:57 -0700 From: Eric Blake MIME-Version: 1.0 References: <1423711034-5340-1-git-send-email-zhang.zhanghailiang@huawei.com> <1423711034-5340-4-git-send-email-zhang.zhanghailiang@huawei.com> In-Reply-To: <1423711034-5340-4-git-send-email-zhang.zhanghailiang@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HEvrIUOm6bSfMQoPUqudCpsqesQ3Vx7wW" Subject: Re: [Qemu-devel] [PATCH RFC v3 03/27] COLO: migrate colo related info to slave List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang , qemu-devel@nongnu.org Cc: Lai Jiangshan , yunhong.jiang@intel.com, eddie.dong@intel.com, dgilbert@redhat.com, peter.huangpeng@huawei.com, Gonglei , stefanha@redhat.com, pbonzini@redhat.com, Yang Hongyang This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HEvrIUOm6bSfMQoPUqudCpsqesQ3Vx7wW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/11/2015 08:16 PM, zhanghailiang wrote: > We can know if we should go into COLO mode by the info that > has been migrated from PVM. >=20 > Signed-off-by: zhanghailiang > Signed-off-by: Yang Hongyang > Signed-off-by: Lai Jiangshan > Signed-off-by: Gonglei > --- > include/migration/migration-colo.h | 21 ++++++++++++++ > migration/Makefile.objs | 1 + > migration/colo-comm.c | 56 ++++++++++++++++++++++++++++++= ++++++++ > vl.c | 5 +++- > 4 files changed, 82 insertions(+), 1 deletion(-) > create mode 100644 include/migration/migration-colo.h > create mode 100644 migration/colo-comm.c > + > +/* #define DEBUG_COLO */ > + > +#ifdef DEBUG_COLO > +#define DPRINTF(fmt, ...) \ > + do { fprintf(stdout, "COLO: " fmt, ## __VA_ARGS__); } while (0) > +#else > +#define DPRINTF(fmt, ...) \ > + do { } while (0) > +#endif This is not very good (that is, it is a great way to write stale debugging statements that tend to bit-rot, and later fail to compile when you turn debug on). Better is a usage pattern that enforces that the debug compiles but has no impact. For example, see how block/ssh.c defines DPRINTF. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --HEvrIUOm6bSfMQoPUqudCpsqesQ3Vx7wW 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/ iQEcBAEBCAAGBQJU4ntZAAoJEKeha0olJ0NqzL8H/3HPKEunDzjmo0GpZeq6VoZR C8SzrmGB8Z2lJW1ePHCG26N0/TQd6A8icMbmmacrcoMl49yns/z3oUPPF5jeYXY1 kkneGlUkUXhS7wmyZRkUwer5XM3KKbr5CEPZp2cejeLFnOugx/2+tTS3RcoSTN0U n1WSpUK1j1MNOpM3hdfwl2ar2O6HqoE1y+cDqC9hk3OKkd2lTXdHak2bgNS/ragn ySrviI4EDShR6BP41pZfjf6W0sTpY7X5hB8loYFF64HkeyxsdlGSaiu5Za+VMZX7 LQuSR6PiNepg8ILtL7d3Mj21yKUdikrRFBxppSW8ROUsjuw5c8ZJf9JsEZYBwtk= =ZfMw -----END PGP SIGNATURE----- --HEvrIUOm6bSfMQoPUqudCpsqesQ3Vx7wW--