From: Wainer dos Santos Moschetta <wainersm@redhat.com>
To: "Lukáš Doktor" <ldoktor@redhat.com>, qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
ehabkost@redhat.com, crosa@redhat.com
Subject: Re: [PATCH] python: Treat None-return of greeting cmd
Date: Wed, 29 Jan 2020 18:24:42 -0200 [thread overview]
Message-ID: <ba9c2d1b-d4d9-340c-0e6a-66afa4765d76@redhat.com> (raw)
In-Reply-To: <20200120071202.30646-1-ldoktor@redhat.com>
On 1/20/20 5:12 AM, Lukáš Doktor wrote:
> 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: Lukáš Doktor <ldoktor@redhat.com>
> ---
> python/qemu/qmp.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
>
> diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
> index 5c8cf6a056..a3e5de718a 100644
> --- a/python/qemu/qmp.py
> +++ b/python/qemu/qmp.py
> @@ -73,7 +73,7 @@ class QEMUMonitorProtocol(object):
> 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
>
next prev parent reply other threads:[~2020-01-29 20:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 7:12 [PATCH] python: Treat None-return of greeting cmd Lukáš Doktor
2020-01-20 8:22 ` Philippe Mathieu-Daudé
2020-01-29 20:24 ` Wainer dos Santos Moschetta [this message]
2020-01-30 22:16 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba9c2d1b-d4d9-340c-0e6a-66afa4765d76@redhat.com \
--to=wainersm@redhat.com \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=ldoktor@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).