From 5810314e98c6e83b3334c451c7999fff7a27ef78 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Thu, 21 Sep 2017 13:22:34 -0300 Subject: [PATCH 1/2] qemu.py: Call logging.basicConfig() automatically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not all scripts using qemu.py configure the Python logging module, and end up generating a "No handlers could be found for logger" message instead of actual log messages. To avoid requiring every script using qemu.py to configure logging manually, call basicConfig() when creating a QEMUMachine object. This won't affect scripts that already set up logging, but will ensure that scripts that don't configure logging keep working. Reported-by: Kevin Wolf Fixes: 4738b0a85a0c2031fddc71b51cccebce0c4ba6b1 Signed-off-by: Eduardo Habkost Message-Id: <20170921162234.847-1-ehabkost@redhat.com> Reviewed-by: Cleber Rosa Acked-by: Lukáš Doktor Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/qemu.py b/scripts/qemu.py index 5e02dd8e78..73d6031e02 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -89,6 +89,9 @@ def __init__(self, binary, args=None, wrapper=None, name=None, self._qmp = None self._qemu_full_args = None + # just in case logging wasn't configured by the main script: + logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN)) + def __enter__(self): return self From ad904f6689f1ced282b413cb904c166f294a73ee Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Fri, 15 Sep 2017 20:07:44 -0300 Subject: [PATCH 2/2] MAINTAINERS: Add Python scripts Cleber and I are volunteering to review and queue patches for the Python scripts and modules in scripts/. I'm setting "M: Odd fixes" because not all scripts are actively maintained. Signed-off-by: Eduardo Habkost Message-Id: <20170915230744.22942-1-ehabkost@redhat.com> [ehabkost: add tests/*.py too] Signed-off-by: Eduardo Habkost --- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e511ba780f..d3e91496b8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1403,6 +1403,14 @@ S: Maintained F: include/sysemu/cryptodev*.h F: backends/cryptodev*.c +Python scripts +M: Eduardo Habkost +M: Cleber Rosa +S: Odd fixes +F: scripts/qmp/* +F: scripts/*.py +F: tests/*.py + QAPI M: Markus Armbruster M: Michael Roth