]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuAgentCheckError: Use 'VIR_ERR_AGENT_COMMAND_FAILED'
authorPeter Krempa <pkrempa@redhat.com>
Thu, 20 Mar 2025 15:17:23 +0000 (16:17 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 21 Mar 2025 16:46:08 +0000 (17:46 +0100)
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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_agent.c

index b22c9d7e8568678aea19503d97ad4e671c305e44..d4eb4897a4d6e7d006460c8a719f7f6e0579ad27 100644 (file)
@@ -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));