From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [PATCH] qga: fix assert regression on guest-shutdown
Date: Thu, 4 Jun 2020 15:43:16 +0200 [thread overview]
Message-ID: <CAATJJ0KpmbbdojFy5uHyh01VdidBEBMBtcmqrKnMyhzASrN2hw@mail.gmail.com> (raw)
In-Reply-To: <20200604094425.63020-1-marcandre.lureau@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]
On Thu, Jun 4, 2020 at 11:46 AM Marc-André Lureau <
marcandre.lureau@redhat.com> wrote:
> Since commit 781f2b3d1e ("qga: process_event() simplification"),
> send_response() is called unconditionally, but will assert when "rsp" is
> NULL. This may happen with QCO_NO_SUCCESS_RESP commands, such as
> "guest-shutdown".
>
> Fixes: 781f2b3d1e5ef389b44016a897fd55e7a780bf35
> Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
> Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> qga/main.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/qga/main.c b/qga/main.c
> index f0e454f28d3..3febf3b0fdf 100644
> --- a/qga/main.c
> +++ b/qga/main.c
> @@ -531,7 +531,11 @@ static int send_response(GAState *s, const QDict *rsp)
> QString *payload_qstr, *response_qstr;
> GIOStatus status;
>
> - g_assert(rsp && s->channel);
> + g_assert(s->channel);
> +
> + if (!rsp) {
> + return 0;
> + }
>
>
>
Thanks Marc-André,
LGTM and should fix the issues I was seeing.
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
--
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
[-- Attachment #2: Type: text/html, Size: 2112 bytes --]
next prev parent reply other threads:[~2020-06-04 13:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 9:44 [PATCH] qga: fix assert regression on guest-shutdown Marc-André Lureau
2020-06-04 10:09 ` Philippe Mathieu-Daudé
2020-06-04 13:43 ` Christian Ehrhardt [this message]
2020-06-09 11:15 ` Christian Ehrhardt
2020-06-15 7:24 ` Christian Ehrhardt
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=CAATJJ0KpmbbdojFy5uHyh01VdidBEBMBtcmqrKnMyhzASrN2hw@mail.gmail.com \
--to=christian.ehrhardt@canonical.com \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.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).