[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen master] qga: fix assert regression on guest-shutdown



commit 844bd70b5652f30bbace89499f513e3fbbb6457a
Author:     Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
AuthorDate: Thu Jun 4 11:44:25 2020 +0200
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Mon Jul 13 17:17:08 2020 -0500

    qga: fix assert regression on guest-shutdown
    
    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@xxxxxxxxxxxxxxxxxx>
    Reported-by: Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
    Reviewed-by: Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx>
    Tested-by: Christian Ehrhardt <christian.ehrhardt@xxxxxxxxxxxxx>
    Cc: qemu-stable@xxxxxxxxxx
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 qga/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qga/main.c b/qga/main.c
index f0e454f28d..3febf3b0fd 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;
+    }
 
     payload_qstr = qobject_to_json(QOBJECT(rsp));
     if (!payload_qstr) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.