Received: from eggs.gnu.org ([2001:4830:134:3::10]:42760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkYtw-0001rC-11 for qemu-devel@nongnu.org; Thu, 15 Sep 2016 11:48:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkYtq-0005oF-VL for qemu-devel@nongnu.org; Thu, 15 Sep 2016 11:48:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkYtq-0005oA-Mi for qemu-devel@nongnu.org; Thu, 15 Sep 2016 11:48:30 -0400 References: <1473874851-22445-1-git-send-email-ashijeetacharya@gmail.com> From: Eric Blake Message-ID: Date: Thu, 15 Sep 2016 10:48:28 -0500 MIME-Version: 1.0 In-Reply-To: <1473874851-22445-1-git-send-email-ashijeetacharya@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="D2Kfs1laB0tJnuwwMIkbgwn00BxpEmjgX" Subject: Re: [Qemu-devel] [PATCH v6] migrate: move max-bandwidth and downtime-limit to migrate_set_parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ashijeet Acharya , lcapitulino@redhat.com Cc: quintela@redhat.com, amit.shah@redhat.com, armbru@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --D2Kfs1laB0tJnuwwMIkbgwn00BxpEmjgX From: Eric Blake To: Ashijeet Acharya , lcapitulino@redhat.com Cc: quintela@redhat.com, amit.shah@redhat.com, armbru@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, qemu-devel@nongnu.org Message-ID: Subject: Re: [PATCH v6] migrate: move max-bandwidth and downtime-limit to migrate_set_parameter References: <1473874851-22445-1-git-send-email-ashijeetacharya@gmail.com> In-Reply-To: <1473874851-22445-1-git-send-email-ashijeetacharya@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/14/2016 12:40 PM, Ashijeet Acharya wrote: > Mark the old commands 'migrate_set_speed' and 'migrate_set_downtime' as= > deprecated. > Move max-bandwidth and downtime-limit into migrate-set-parameters for > setting maximum migration speed and expected downtime limit parameters > respectively. > Change downtime units to milliseconds (only for new-command) and set > its upper bound limit to 2000 seconds. > Update the query part in both hmp and qmp qemu control interfaces. >=20 > Signed-off-by: Ashijeet Acharya > --- > +++ b/migration/migration.c > @@ -804,6 +802,20 @@ void qmp_migrate_set_parameters(MigrationParameter= s *params, Error **errp) > "cpu_throttle_increment", > "an integer in the range of 1 to 99"); > } > + if (params->has_max_bandwidth && > + (params->max_bandwidth < 0 || params->max_bandwidth > SIZE_MAX= )) { > + error_setg(errp, QERR_INVALID_PARAMETER_VALUE "%zu", > + "max_bandwidth", > + "an integer in the range of 0 to ", SIZE_MAX); That looks weird (not necessarily your fault; but it explains why we've been trying to avoid new QERR_ macros). No other use of QERR_INVALID_PARAMETER_VALUE adds additional text. So I'm thinking it's better to just follow suit with a shorter non-parameterized message; such as in this instance: balloon.c: error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size"); Or, just open-code the full error message, instead of having half the message hidden behind the QERR_INVALID_PARAMETER_VALUE macro. Otherwise, it looks good to me. With the error message sorted out, you can add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --D2Kfs1laB0tJnuwwMIkbgwn00BxpEmjgX 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/ iQEcBAEBCAAGBQJX2sLMAAoJEKeha0olJ0NquiMH/AuQ5bC0YVr9uegwiKNFgTci FMQxd0UwjOr85tTDbwNHurhytTcNnojoltlGV78nhtS5VXh8duuVVS1AOr+11i6/ Ao2Xl9wnY6ovLHB/ZjuCTwWEOr1u2hWXND307C61NNOQ0tl16wzwSWYDIkBI6DEU kD/fEKRG4if548DGjxTI+nQQlU8vCUll6Om+JQk2bmlyjt4IiH/IU5IRq5B+ZbeK +I4QMWLqt8fTOYcZqeEPsR0K4cY8Fdfeo+D/mCyQr6ufoky83pJvLOd7sqMOZv8Z J32kVZPj/VDtG8/NfvDfPFcu1JOMwwWGSpjPgCLnFo9oNKdW7r7h34V6ydqtOR4= =unAz -----END PGP SIGNATURE----- --D2Kfs1laB0tJnuwwMIkbgwn00BxpEmjgX--