From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Dbn-00052P-EZ for qemu-devel@nongnu.org; Mon, 07 Jul 2014 14:25:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4Dbh-00068y-Lu for qemu-devel@nongnu.org; Mon, 07 Jul 2014 14:25:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Dbh-00068p-Ds for qemu-devel@nongnu.org; Mon, 07 Jul 2014 14:25:41 -0400 Message-ID: <53BAE622.8070706@redhat.com> Date: Mon, 07 Jul 2014 12:25:38 -0600 From: Eric Blake MIME-Version: 1.0 References: <1404753484-26693-1-git-send-email-sanidhya.iiith@gmail.com> <1404753484-26693-5-git-send-email-sanidhya.iiith@gmail.com> In-Reply-To: <1404753484-26693-5-git-send-email-sanidhya.iiith@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fwlVs2l2kT2GCMIFUR4obueM2U2HOAvUE" Subject: Re: [Qemu-devel] [RFC PATCH v1 4/5] VMState test: set the frequency of the vmstate testing process List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sanidhya Kashyap , qemu list Cc: "Dr. David Alan Gilbert" , Juan Quintela This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fwlVs2l2kT2GCMIFUR4obueM2U2HOAvUE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/07/2014 11:18 AM, Sanidhya Kashyap wrote: > This patch introduces the mechanism to update the sleep interval - sint= erval. >=20 > Signed-off-by: Sanidhya Kashyap > --- > hmp-commands.hx | 15 +++++++++++++++ > hmp.c | 14 ++++++++++++++ > hmp.h | 1 + > qapi-schema.json | 10 ++++++++++ > qmp-commands.hx | 22 ++++++++++++++++++++++ > savevm.c | 13 +++++++++++++ > 6 files changed, 75 insertions(+) >=20 > +++ b/qapi-schema.json > @@ -3492,3 +3492,13 @@ > { 'command': 'test-vmstates', > 'data': {'*times' : 'int', > '*sinterval' : 'int' } } > + > +## @test-vmstates-set-sinterval > +# > +# sets the sleep interval between iterations of the vmstate testing pr= ocess > +# @sinterval: the updated sleep interval value in what units? > +# > +# Since 2.1 2.2. > +## > +{ 'command' : 'test-vmstates-set-sinterval', > + 'data' : { 'sinterval': 'int' } } This feels like a write-only command. How do I query what it is currently set to? I'm also afraid that we aren't learning our lessons from migrate. Adding one new command per new tunable does not scale very well in the number of commands that need to be maintained or that have to be wired up in management software; better is adding a single command pair for set/get that can be easily introspected (to see when new tunables are added), by taking an array of tunables where each tunable is a struct containing name, type, and value information. Something like: {"execute":"test-vmstates-set-tuning", "arguments":{ "list":[ { "name":"sinterval", "type":"int", "value":100 }, { "name":"other", "type":"...", "value":... } ]}} {"return": {}} and a counterpart: {"execute":"test-vmstates-get-tuning" } {"return": [ { "name":"sinterval", "type":"int", "value":100 }, { "name":"other", "type":"...", "value":... } ]} > +void qmp_test_vmstates_set_sinterval(int64_t sinterval, Error **errp) > +{ > + VMStateLogState *v =3D vmstate_current_state(); > + if (sinterval < TEST_VMSTATE_MIN_INTERVAL_MS || > + sinterval > TEST_VMSTATE_MAX_INTERVAL_MS) { > + error_setg(errp, "sleep interval value must be " > + "in the defined range [%d, %d](ms)\n", > + TEST_VMSTATE_MIN_INTERVAL_MS, TEST_VMSTATE_MAX_INTE= RVAL_MS); This range limit should also be mentioned in the public API (.json) file.= --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --fwlVs2l2kT2GCMIFUR4obueM2U2HOAvUE 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/ iQEcBAEBCAAGBQJTuuYiAAoJEKeha0olJ0NqLowH/i/lQfojdfnfi3QOYCJcgqrY Ok+gXzuqonTRUx65J+51c7lkesBzf17NmXDgO6/7zTu1PvH8vL5ThVcXlldBcSXK UHjQPFgrJp1Q0p8yVJugObCJxPTDvNjh5Z7fbZUb98SbXqZHVsEKSzN5XqKorMMM urK7ATyCePwc34OeGG4uCpENr3/3V5viZfANtI2wySTTbGkdqj772V0+mb4LKADR zQluHizp6BNT1lJX+axTVTViKx778lORhONdgm7WWnwpd7Xn3lzfOCvwHL1EAY4g ctH0r/8GHHydT92q81N+zgbSUj6ynE7x9Q9QHR7CX+uG4CAcorgi0R7i6B9fzF8= =0Laq -----END PGP SIGNATURE----- --fwlVs2l2kT2GCMIFUR4obueM2U2HOAvUE--