From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf5Mp-0004ht-US for qemu-devel@nongnu.org; Wed, 31 Aug 2016 09:15:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bf5Mj-0000KN-8x for qemu-devel@nongnu.org; Wed, 31 Aug 2016 09:15:46 -0400 Date: Wed, 31 Aug 2016 15:15:32 +0200 From: Kevin Wolf Message-ID: <20160831131532.GB7070@noname.redhat.com> References: <1471963560-1433-1-git-send-email-kwolf@redhat.com> <57BC9CFB.1090604@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline In-Reply-To: <57BC9CFB.1090604@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qemu-iotests: Log QMP traffic in debug mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 23.08.2016 um 20:59 hat Eric Blake geschrieben: > On 08/23/2016 09:46 AM, Kevin Wolf wrote: > > Python tests are already annoying enough to debug. With QMP traffic > > available it's a little bit easier at least. > >=20 > > Signed-off-by: Kevin Wolf > > --- > > tests/qemu-iotests/iotests.py | 5 +++++ > > 1 file changed, 5 insertions(+) > >=20 > > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests= =2Epy > > index 03bccdd..3329bc1 100644 > > --- a/tests/qemu-iotests/iotests.py > > +++ b/tests/qemu-iotests/iotests.py > > @@ -50,6 +50,7 @@ cachemode =3D os.environ.get('CACHEMODE') > > qemu_default_machine =3D os.environ.get('QEMU_DEFAULT_MACHINE') > > =20 > > socket_scm_helper =3D os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_= helper') > > +debug =3D False > > =20 > > def qemu_img(*args): > > '''Run qemu-img and return the exit code''' > > @@ -134,6 +135,8 @@ class VM(qtest.QEMUQtestMachine): > > def __init__(self): > > super(VM, self).__init__(qemu_prog, qemu_opts, test_dir=3Dtest= _dir, > > socket_scm_helper=3Dsocket_scm_helper) > > + if debug: > > + self._debug =3D True > > self._num_drives =3D 0 > > =20 >=20 > So we already had plumbing for debug... >=20 > > def add_device(self, opts): > > @@ -323,6 +326,8 @@ def verify_quorum(): > > def main(supported_fmts=3D[], supported_oses=3D['linux']): > > '''Run tests''' > > =20 > > + global debug >=20 > ...but just needed to turn it on? Yes, the parent class already implements the logging. I guess this was done in the context of some other scripts (maybe QMP shell?), so we just have to reuse what's already there. Kevin --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXxth0AAoJEH8JsnLIjy/WRQEP/A9ud1wGKBEtBLRX7qzsMLLD HRZIZ0daVNe3Vaw3RXptoLyGzTlSZb4qtHcNfV1kFm7UzDxzFZrCM3W9HwfHK/DK GpwNiwZjmLNsY/KgXMvscX2KADsg6/J/DK+nUKMvpaNzq2w4pTB6/LkDQbvywPuk rrMveWDgt0O6LVGzfxvfCuteZlj/rrXKm8VEYOrrjC3JmJrUHrBtMEiEuoxenaYo gYO9LWlvmv54uhTm9lO3wf6Qj8R1Rz7ZgD8n2Bl9uNMS/T+GUvm0il5gx1IfB8jU E4wL0+d+AUhX3yfRTgkCY4BAqzXbWD14eynyi0+yc79LzGM34FPPZhSf0nobxYnh dYQaxCBK2ufltqHTRYcS2yAGbCcXenzKvFqr0Ig7k+LyzP3dXHzD5Lo0bDQN3m+B clHCcQBiGw9GiXorBcsn3DKYwpJpKMi1qJaZo+yWcEfgVUdtiKFXHBDqXq9YZV80 XDIbE4R8goiHBQ03o8Xv0u+nt9vC57ZWOLX8VKHqF3xHMnnkk4StyxF06c1UfeZr pwX13Ot8PNuocpTXnkqBmtqpHkDQHAKoTz/MojY0ay9Dsp8z6ZDIOahC2yc2FYm+ jIeRdEsecnAEgjaaIF1C2tySax44zb+BvmC8poQkadjKESyCHXKIIEqmwhf/9z1l pglpRajFjHJPeXylC7wS =8a9x -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--