From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4CnE-0007R2-V2 for qemu-devel@nongnu.org; Mon, 07 Jul 2014 13:33:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4Cn8-00064A-Gw for qemu-devel@nongnu.org; Mon, 07 Jul 2014 13:33:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Cn8-00063N-8x for qemu-devel@nongnu.org; Mon, 07 Jul 2014 13:33:26 -0400 Message-ID: <53BAD9E2.5050901@redhat.com> Date: Mon, 07 Jul 2014 11:33:22 -0600 From: Eric Blake MIME-Version: 1.0 References: <1404753484-26693-1-git-send-email-sanidhya.iiith@gmail.com> <1404753484-26693-3-git-send-email-sanidhya.iiith@gmail.com> In-Reply-To: <1404753484-26693-3-git-send-email-sanidhya.iiith@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HMiT91FmVPWcdq3iBeenADPkpVc74p5ip" Subject: Re: [Qemu-devel] [RFC PATCH v1 2/5] VMState test: basic vmstate testing mechanism 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) --HMiT91FmVPWcdq3iBeenADPkpVc74p5ip 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 test the devices state by storin= g > and dumping in in the QEMUFile pointer. >=20 > The testing is done as follows: > 1) The VM is halted. > 2) guest state is synchronized. > 3) Then the device state is dumped to a temporary memory. > 4) The guest state is reset. > 5) Then the device state is loaded from the temporary memory. > 6) The guest is resumed. >=20 > + > +## @test-vmstates > +# > +# tests the vmstates' value by dumping and loading in memory > +# @times: total iterations Missing the #optional flag; what does it default to if not specified? > +# @sinterval: sleep interval between iteration in what unit? Missing the #optional flag; what does it default to if not specified? > +# > +# Since 2.1 You've missed hard freeze for 2.1; this is a new feature, and at the earliest it can only be introduced in 2.2. > +## > +{ 'command': 'test-vmstates', > + 'data': {'*times' : 'int', > + '*sinterval' : 'int' } } > +Arguments: > + > +- "times" : the total iterations for vmstates testing. The default > + value is 10. > +- "sinterval": the sleep interval between the iterations. The default > + value is 100 milliseconds. Ah, you provided more documentation in the .hx file than in the .json. I hate the redundancy, but it's better to include it in both files. > +++ b/savevm.c > @@ -1137,6 +1137,154 @@ void do_savevm(Monitor *mon, const QDict *qdict= ) > } > } > =20 > +#ifdef DEBUG_TEST_VMSTATES > +#define DPRINTF(fmt, ...) \ > + do { printf("vmstate_test: " fmt, ## __VA_ARGS__); } while (0) > +#else > +#define DPRINTF(fmt, ...) \ > + do { } while (0) > +#endif Wasn't there another series proposed that ensures that even when debugging is disabled that the compiler still compiles printf* statements under an if(0) block to prevent bit-rot? I didn't bother to look it up now in the archives, but you should reuse that approach. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --HMiT91FmVPWcdq3iBeenADPkpVc74p5ip 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/ iQEcBAEBCAAGBQJTutniAAoJEKeha0olJ0NqgVoH/jDC+OuCtjsDzsHao62rN0XK SKzLgWyDmDgBuuom15w9fPrcnfqgOcvhvadvbERZLEpbih/LgI9XcR9ZV4yDq2YO 9x7bjbAFpqIapKAzfEDXs8fFdCs8HYXHBcy7HvIHfoYQ7TPy9yqlIkBDDuEeNxw8 LE9tRQQp9JN/a9opY2IGg0t5lugQyen0vPG3twZyNz7wg2/k0bu1zuMmAQCUhwv3 hi6tgYyZXwYvl9Sufaf+bBk1twx6HgRKMVImlBUVFRj9kNKqXaltIyuIlZwvZ8hk +Ym3gv023vMjRFRbHjkyxBWWJiDurfUIE8BjGXkBdBEhG+imbVLmdMdD4P3ts4o= =I5fr -----END PGP SIGNATURE----- --HMiT91FmVPWcdq3iBeenADPkpVc74p5ip--