From: Daan De Meyer Date: Thu, 25 Apr 2024 18:57:11 +0000 (+0200) Subject: qemu: Always how many notify messages we received X-Git-Tag: v23.1~90^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8e4f132180191c329177974ea75ce815530cb76;p=thirdparty%2Fmkosi.git qemu: Always how many notify messages we received --- diff --git a/mkosi/qemu.py b/mkosi/qemu.py index 516f21bc0..2a26aeb13 100644 --- a/mkosi/qemu.py +++ b/mkosi/qemu.py @@ -409,11 +409,12 @@ def vsock_notify_handler() -> Iterator[tuple[str, dict[str, str]]]: messages[k] = v with AsyncioThread(notify()): - yield f"vsock-stream:{socket.VMADDR_CID_HOST}:{vsock.getsockname()[1]}", messages - - logging.debug(f"Received {num_messages} notify messages totalling {format_bytes(num_bytes)} bytes") - for k, v in messages.items(): - logging.debug(f"- {k}={v}") + try: + yield f"vsock-stream:{socket.VMADDR_CID_HOST}:{vsock.getsockname()[1]}", messages + finally: + logging.debug(f"Received {num_messages} notify messages totalling {format_bytes(num_bytes)} bytes") + for k, v in messages.items(): + logging.debug(f"- {k}={v}") @contextlib.contextmanager