From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuMNA-0000fG-Lb for qemu-devel@nongnu.org; Mon, 18 May 2015 10:50:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuMN5-0000CE-AF for qemu-devel@nongnu.org; Mon, 18 May 2015 10:50:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuMN5-0000By-4e for qemu-devel@nongnu.org; Mon, 18 May 2015 10:50:23 -0400 Message-ID: <5559FC2D.4030602@redhat.com> Date: Mon, 18 May 2015 08:50:21 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431620920-19710-1-git-send-email-quintela@redhat.com> <1431620920-19710-4-git-send-email-quintela@redhat.com> <5559C128.7020109@parallels.com> In-Reply-To: <5559C128.7020109@parallels.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="P7gXkcxdaUrlQmvPiNHcwJIFTT1su14Xj" Subject: Re: [Qemu-devel] [PATCH 3/9] runstate: Add runstate store List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , Juan Quintela , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --P7gXkcxdaUrlQmvPiNHcwJIFTT1su14Xj Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/18/2015 04:38 AM, Denis V. Lunev wrote: > On 14/05/15 19:28, Juan Quintela wrote: >> This allows us to store the current state to send it through migration= =2E >> >> Signed-off-by: Juan Quintela >> --- >> + if (strlen(state)+1 > size) { >> + return -1; >> + } >> + strncpy(str, state, strlen(state)+1); >> + return 0; >> +} >> + >> static void runstate_init(void) >> { >> const RunStateTransition *p; >> >=20 > minor. why to call strlen() twice? Also, why no spaces around binary '+'? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --P7gXkcxdaUrlQmvPiNHcwJIFTT1su14Xj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVWfwtAAoJEKeha0olJ0NqcyQH/inTKOEFJ1glmrhXwGdsEwPC De59nC1jMcsGKOihnxMFgRcINmcoCq2sXnsyYFFbd/ZzVWWkLeVeQvJJJt7V5PQl 56+bMaw44JzU7tNIQbjRDD0Mn43aYahqYHVbj+qtcNXzyl30dqqPEOHs3yxFj9Yt 95UmsFvW0Ndpal6Kq/8Hc3eqmgb/oQ8cDJJS6kYyl9zzM3u/6lSD68z5i5Qen5yG /mOyVav+WLS4qN9Fum8r0y9aoSZGg3l5MAJZB6hjh7zFFzyHzWi3TgcHIBocRpWX DEoCp70dXkigwGutipOzqr26+7LqBFJJesooKH28zdrUfvrMxvRZpSczhCqep1w= =CIpf -----END PGP SIGNATURE----- --P7gXkcxdaUrlQmvPiNHcwJIFTT1su14Xj--