qemu: guestinfo: handle unsupported agent commands

When we're collecting guest information, older agents may not support
all agent commands. In the case where the user requested all info
types (i.e. types == 0), ignore unsupported command errors and gather as
much information as possible. If the agent command failed for some other
reason, or if the user explciitly requested a specific info type (i.e.
types != 0), abort on the first error.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jonathon Jongsma
2019-08-27 15:35:54 -05:00
committed by Michal Privoznik
parent 56cac62bfd
commit a931486a97
3 changed files with 82 additions and 23 deletions

View File

@@ -462,7 +462,7 @@ testQemuAgentGetFSInfoParams(const void *data)
goto cleanup;
if (qemuAgentGetFSInfoParams(qemuMonitorTestGetAgent(test), &params,
&nparams, &maxparams, def) != -1) {
&nparams, &maxparams, def) != -2) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
"agent get-fsinfo command should have failed");
goto cleanup;