qemu: agent: give better error messages whe agent monitor is down

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.
This commit is contained in:
Nikolay Shirokovskiy 2016-09-16 13:35:36 +03:00 committed by Michal Privoznik
parent 3f90a1aac0
commit 6bff9c03c9
1 changed files with 6 additions and 2 deletions

View 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;
}
}