From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1kdd-0004bl-3l for qemu-devel@nongnu.org; Mon, 09 Oct 2017 22:51:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1kdA-0004An-QP for qemu-devel@nongnu.org; Mon, 09 Oct 2017 22:51:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60864) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e1kdA-00049x-Ce for qemu-devel@nongnu.org; Mon, 09 Oct 2017 22:50:52 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C32046289 for ; Tue, 10 Oct 2017 02:50:51 +0000 (UTC) Date: Mon, 9 Oct 2017 23:50:49 -0300 From: Eduardo Habkost Message-ID: <20171010025049.GA4015@localhost.localdomain> References: <20171005172013.3098-1-ehabkost@redhat.com> <20171005172013.3098-4-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 3/3] scripts: Remove debug parameter from QEMUMachine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?THVrw6HFoQ==?= Doktor Cc: qemu-devel@nongnu.org, "Daniel P. Berrange" , Cleber Rosa On Sat, Oct 07, 2017 at 10:34:57AM +0200, Luk=C3=A1=C5=A1 Doktor wrote: > Dne 5.10.2017 v 19:20 Eduardo Habkost napsal(a): > > All scripts that use the QEMUMachine and QEMUQtestMachine classes > > (device-crash-test, tests/migration/*, iotests.py, basevm.py) > > already configure logging. > >=20 > > The basicConfig() call inside QEMUMachine.__init__() is being > > kept just to make sure a script would still work if it didn't > > configure logging. > >=20 > > Signed-off-by: Eduardo Habkost > > --- > > scripts/qemu.py | 6 ++---- > > tests/migration/guestperf/engine.py | 6 ++---- > > tests/qemu-iotests/iotests.py | 2 -- > > 3 files changed, 4 insertions(+), 10 deletions(-) > >=20 > > diff --git a/scripts/qemu.py b/scripts/qemu.py > > index f6d2e68627..9bfdf6d37d 100644 > > --- a/scripts/qemu.py > > +++ b/scripts/qemu.py > > @@ -54,7 +54,7 @@ class QEMUMachine(object): > > =20 > > def __init__(self, binary, args=3DNone, wrapper=3DNone, name=3DN= one, > > test_dir=3D"/var/tmp", monitor_address=3DNone, > > - socket_scm_helper=3DNone, debug=3DFalse): > > + socket_scm_helper=3DNone): > > ''' > > Initialize a QEMUMachine > > =20 > > @@ -65,7 +65,6 @@ class QEMUMachine(object): > > @param test_dir: where to create socket and log file > > @param monitor_address: address for QMP monitor > > @param socket_scm_helper: helper program, required for send_= fd_scm()" > > - @param debug: enable debug mode > > @note: Qemu process is not started until launch() is used. > > ''' > > if args is None: > > @@ -85,12 +84,11 @@ class QEMUMachine(object): > > self._events =3D [] > > self._iolog =3D None > > self._socket_scm_helper =3D socket_scm_helper > > - self._debug =3D debug > > self._qmp =3D None > > self._qemu_full_args =3D None > > =20 > > # just in case logging wasn't configured by the main script: > > - logging.basicConfig(level=3D(logging.DEBUG if debug else log= ging.WARN)) > > + logging.basicConfig() > Yes, this behaves the same as `debug=3DFalse` >=20 > > =20 > > def __enter__(self): > > return self > > diff --git a/tests/migration/guestperf/engine.py b/tests/migration/gu= estperf/engine.py > > index 0a13050bc6..e14d4320b2 100644 > > --- a/tests/migration/guestperf/engine.py > > +++ b/tests/migration/guestperf/engine.py > > @@ -388,15 +388,13 @@ class Engine(object): > > args=3Dself._get_src_args(hardware), > > wrapper=3Dself._get_src_wrapper(hardw= are), > > name=3D"qemu-src-%d" % os.getpid(), > > - monitor_address=3Dsrcmonaddr, > > - debug=3Dself._debug) > > + monitor_address=3Dsrcmonaddr) > > =20 > > dst =3D qemu.QEMUMachine(self._binary, > > args=3Dself._get_dst_args(hardware, u= ri), > > wrapper=3Dself._get_dst_wrapper(hardw= are), > > name=3D"qemu-dst-%d" % os.getpid(), > > - monitor_address=3Ddstmonaddr, > > - debug=3Dself._debug) > > + monitor_address=3Ddstmonaddr) > > =20 > > try: > > src.launch() > > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotes= ts.py > > index 36a7757aaf..6f057904a9 100644 > > --- a/tests/qemu-iotests/iotests.py > > +++ b/tests/qemu-iotests/iotests.py > > @@ -195,8 +195,6 @@ class VM(qtest.QEMUQtestMachine): > > super(VM, self).__init__(qemu_prog, qemu_opts, name=3Dname, > > test_dir=3Dtest_dir, > > socket_scm_helper=3Dsocket_scm_help= er) > > - if debug: > > - self._debug =3D True >=20 > And this is the main issue. So instead of the fix I proposed in > previous commit major changes to > "tests/qemu-iotests/iotests.py" are necessary. Could you clarify what those major changes are? iotests.py was already changed to call basicConfig() according to args.debug in main(). >=20 > > self._num_drives =3D 0 > > =20 > > def add_device(self, opts): > >=20 >=20 --=20 Eduardo