summaryrefslogtreecommitdiffstats
path: root/python/qemu
diff options
context:
space:
mode:
authorJohn Snow2021-09-23 02:49:27 +0200
committerJohn Snow2021-10-12 18:22:11 +0200
commit3e55dc35b8ed8cea53ef2604874d2fe882fbadc1 (patch)
tree2f272f18e7fb4405387d225944e28a9e504ccfc8 /python/qemu
parentpython/aqmp: Add dict conversion method to Greeting object (diff)
downloadqemu-3e55dc35b8ed8cea53ef2604874d2fe882fbadc1.tar.gz
qemu-3e55dc35b8ed8cea53ef2604874d2fe882fbadc1.tar.xz
qemu-3e55dc35b8ed8cea53ef2604874d2fe882fbadc1.zip
python/aqmp: Reduce severity of EOFError-caused loop terminations
When we encounter an EOFError, we don't know if it's an "error" in the perspective of the user of the library yet. Therefore, we should not log it as an error. Reduce the severity of this logging message to "INFO" to indicate that it's something that we expect to occur during the normal operation of the library. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20210923004938.3999963-7-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/qemu')
-rw-r--r--python/qemu/aqmp/protocol.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/qemu/aqmp/protocol.py b/python/qemu/aqmp/protocol.py
index 32e78749c1..ae1df24026 100644
--- a/python/qemu/aqmp/protocol.py
+++ b/python/qemu/aqmp/protocol.py
@@ -721,8 +721,11 @@ class AsyncProtocol(Generic[T]):
self.logger.debug("Task.%s: cancelled.", name)
return
except BaseException as err:
- self.logger.error("Task.%s: %s",
- name, exception_summary(err))
+ self.logger.log(
+ logging.INFO if isinstance(err, EOFError) else logging.ERROR,
+ "Task.%s: %s",
+ name, exception_summary(err)
+ )
self.logger.debug("Task.%s: failure:\n%s\n",
name, pretty_traceback())
self._schedule_disconnect()