]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: agent: give better error messages whe agent monitor is down
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Fri, 16 Sep 2016 10:35:36 +0000 (13:35 +0300)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Sep 2016 14:27:58 +0000 (16:27 +0200)
We can receive NULL as sync reply in two situations. First
is garbage sync reply and this situation is handled by
resending sync message. Second is different cases
of rebooting guest, destroing domain etc and we can
give more meaningful error message. Actually we have
this error message in qemuAgentCommand already which checks
for the same sitatuion. AFAIK case with mon->running
is just to be safe on adding some future(?) cases of
returning NULL reply.

src/qemu/qemu_agent.c

index f3d54f6bacd4de771eff188a3197e3a3985a3389..ec8d47e0586c929986c51f5acdc736fd33496589 100644 (file)
@@ -992,8 +992,12 @@ qemuAgentGuestSync(qemuAgentPtr mon)
             memset(&sync_msg, 0, sizeof(sync_msg));
             goto retry;
         } else {
-            virReportError(VIR_ERR_AGENT_UNSYNCED, "%s",
-                           _("Missing monitor reply object"));
+            if (mon->running)
+                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                               _("Missing monitor reply object"));
+            else
+                virReportError(VIR_ERR_AGENT_UNRESPONSIVE, "%s",
+                               _("Guest agent disappeared while executing command"));
             goto cleanup;
         }
     }