From b38d66e81e8906e0e5b490e8a2dcebc43c137179 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 20 Mar 2025 16:17:23 +0100 Subject: [PATCH] qemuAgentCheckError: Use 'VIR_ERR_AGENT_COMMAND_FAILED' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In the two cases when we know that the command returned failure switch to the new error code so that management applications can programatically detect failure of the guest agent command. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_agent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index b22c9d7e85..d4eb4897a4 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -985,7 +985,7 @@ qemuAgentCheckError(virJSONValue *cmd, /* Only send the user the command name + friendly error */ if (!error) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_AGENT_COMMAND_FAILED, _("unable to execute QEMU agent command '%1$s'"), qemuAgentCommandName(cmd)); return -1; @@ -999,7 +999,7 @@ qemuAgentCheckError(virJSONValue *cmd, return -2; } - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_AGENT_COMMAND_FAILED, _("unable to execute QEMU agent command '%1$s': %2$s"), qemuAgentCommandName(cmd), qemuAgentStringifyError(error)); -- 2.47.3