qemurunner: Ensure logging handler is removed

If we don't remove the handler we end up with duplicate log messages
which is undesireable.

(From OE-Core rev: 39e6194615b139e2b772084641940fffa2c9380f)

(From OE-Core rev: 074b510c8720e82e5f5978e2824d2168f7f11139)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2017-11-07 23:23:54 +00:00
parent 768dad3469
commit 23037f8c91
1 changed files with 3 additions and 1 deletions

View File

@ -58,7 +58,8 @@ class QemuRunner:
self.host_dumper = HostDumper(dump_host_cmds, dump_dir)
self.logger = logging.getLogger("BitBake.QemuRunner")
self.logger.addHandler(logging.StreamHandler(sys.stdout))
self.handler = logging.StreamHandler(sys.stdout)
self.logger.addHandler(self.handler)
def create_socket(self):
try:
@ -369,6 +370,7 @@ class QemuRunner:
self.ip = None
if os.path.exists(self.qemu_pidfile):
os.remove(self.qemu_pidfile)
self.logger.removeHandler(self.handler)
def stop_qemu_system(self):
if self.qemupid: