From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEgnR-0002IR-Hp for qemu-devel@nongnu.org; Fri, 23 Jan 2015 11:09:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEgnM-0000O2-Dw for qemu-devel@nongnu.org; Fri, 23 Jan 2015 11:09:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEgnM-0000Nx-6U for qemu-devel@nongnu.org; Fri, 23 Jan 2015 11:09:16 -0500 Message-ID: <54C27228.7090900@redhat.com> Date: Fri, 23 Jan 2015 09:09:12 -0700 From: Eric Blake MIME-Version: 1.0 References: <1418347746-15829-1-git-send-email-liang.z.li@intel.com> <1418347746-15829-3-git-send-email-liang.z.li@intel.com> In-Reply-To: <1418347746-15829-3-git-send-email-liang.z.li@intel.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FXu7qa0O4jpUV6fHWEaXCM6ND0WWARouf" Subject: Re: [Qemu-devel] [v3 02/13] migration: Add the framework of multi-thread compression List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liang Li , qemu-devel@nongnu.org Cc: yang.z.zhang@intel.com, lcapitulino@redhat.com, armbru@redhat.com, dgilbert@redhat.com, quintela@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FXu7qa0O4jpUV6fHWEaXCM6ND0WWARouf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/11/2014 06:28 PM, Liang Li wrote: > Signed-off-by: Liang Li > Signed-off-by: Yang Zhang > --- > +void migrate_compress_threads_create(MigrationState *s) > +{ > + int i, thread_count; > + > + if (!migrate_use_compression()) { > + return; > + } > + quit_thread =3D false; > + thread_count =3D migrate_compress_threads(); > + s->compress_thread =3D g_malloc0(sizeof(QemuThread) > + * thread_count); Theoretically unsafe (well, unsafe if thread_count were unbounded, although it looks like you artificially cap it at 255 later in the series); better would be: s->compress_thread =3D g_new0(QemuThread, thread_count) because that catches potential multiplication overflow. > + comp_param =3D g_malloc0(sizeof(compress_param) * thread_count); Likewise. > =20 > +static int ram_save_compressed_page(QEMUFile *f, RAMBlock* block, Spacing is off on the second '*'. > + ram_addr_t offset, bool last_stage) Indentation is off. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --FXu7qa0O4jpUV6fHWEaXCM6ND0WWARouf 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/ iQEcBAEBCAAGBQJUwnIoAAoJEKeha0olJ0NqfsgH/3zPmpbF27b/zI3FpopgV9JG IFdlTsY2iaosXvXHXS59e4Mh9yEj64wAfJa1+5jp952RW2+7hha8nODgVfg33utt uYvkyzU+LrVxXGTYyua5cLZ8/w6ZQDXGI0qBEQr7koE9zsxfw6cFZhoawgxSj5xp RY6kfIRiioLD5W009NeXZd3yrnTs/05bpg9/0yigt8j+FKAC3skteTYu2mrsWO1Z P/BruYuePJf5AB8ehubBkuSZWIdOzPykdGWBH2UxF7qZtei3kNiLeGjUtLqCxCSS QJ6H2VlJjZKwZrRuBDRcVjjvZtxMSdduLCx4VbBAECCO+R8xr0gz0xf77hvKXLs= =cr0H -----END PGP SIGNATURE----- --FXu7qa0O4jpUV6fHWEaXCM6ND0WWARouf--