提交 52c68b8a 编写于 作者: L Lukáš Doktor 提交者: Philippe Mathieu-Daudé

python: Treat None-return of greeting cmd

In case qemu process dies the "monitor.cmd" returns None which gets
passed to the "__negotiate_capabilities" and leads to unhandled
exception. Let's only check the resp in case it has a value.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: NWainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20200120071202.30646-1-ldoktor@redhat.com>
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
上级 a1e8bd2f
......@@ -80,7 +80,7 @@ class QEMUMonitorProtocol:
raise QMPConnectError
# Greeting seems ok, negotiate capabilities
resp = self.cmd('qmp_capabilities')
if "return" in resp:
if resp and "return" in resp:
return greeting
raise QMPCapabilitiesError
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册