From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tlpl4-0002uE-4H for qemu-devel@nongnu.org; Thu, 20 Dec 2012 18:42:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tlpl1-0006J9-Ts for qemu-devel@nongnu.org; Thu, 20 Dec 2012 18:42:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tlpl1-0006J2-Ls for qemu-devel@nongnu.org; Thu, 20 Dec 2012 18:42:31 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBKNgUu8013813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 20 Dec 2012 18:42:30 -0500 Message-ID: <50D3A265.4040308@redhat.com> Date: Thu, 20 Dec 2012 16:42:29 -0700 From: Eric Blake MIME-Version: 1.0 References: <1355920437-29882-1-git-send-email-quintela@redhat.com> <1355920437-29882-33-git-send-email-quintela@redhat.com> In-Reply-To: <1355920437-29882-33-git-send-email-quintela@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigA3531BFB9542247FEB01212B" Subject: Re: [Qemu-devel] [PATCH 32/34] ram: refactor ram_save_block() return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA3531BFB9542247FEB01212B Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/19/2012 05:33 AM, Juan Quintela wrote: > It could only return 0 if we only found dirty xbzrle pages that hadn't > changed (i.e. they were written with the same content). We don't care > about that case, it is the same than nothing dirty. s/than/as/ >=20 > So now the return of the function is how much have it written, nothing s/have/has/ > else. Adjust callers. >=20 > And we also made ram_save_iterate() return the number of transferred > bytes, not the number of transferred pages. >=20 > Signed-off-by: Juan Quintela > --- > arch_init.c | 25 +++++++++++++++---------- > 1 file changed, 15 insertions(+), 10 deletions(-) >=20 > static int ram_save_block(QEMUFile *f, bool last_stage) > @@ -432,7 +431,7 @@ static int ram_save_block(QEMUFile *f, bool last_st= age) > RAMBlock *block =3D last_seen_block; > ram_addr_t offset =3D last_offset; > bool complete_round =3D false; > - int bytes_sent =3D -1; > + int bytes_sent =3D 0; Are we guaranteed that we will never send more than 2G bytes in one call to this function, or should this be changed to int64_t? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigA3531BFB9542247FEB01212B 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ06JlAAoJEKeha0olJ0NqsrcIAIc1WOB4hZj4wVJ50Mgn+bL5 F3V7WwAQo7PyG5m0P74Vv6cThVxDiHxHSSoF9lP5kxWurjki+CxJ87pXY7YeHH5j l/dljSee++sdhOEkxiZt9z6FxLI/+Ro7kQYjRhSa4ZviOzVK8MiO6kUOfQ+q+N3f itNwE0JKfv7+OI5OjZmSV2smRsmF/omFoIojIiKhe3TTd5FsiLBw8OgJK9jmcfSJ s/kJktNwsFkWJm52MDoKbjpeWTCsju9KDxdY3uGlaK8YOu/wOm9z/dGECBpVBhHx eqCxjtCfKHVwPoC1sEEp5xHuZz29heY6AuIUZddjjloMPILc42gSiy58D6PSuO4= =VX5B -----END PGP SIGNATURE----- --------------enigA3531BFB9542247FEB01212B--