]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lib: error: Introduce 'VIR_ERR_AGENT_COMMAND_FAILED'
authorPeter Krempa <pkrempa@redhat.com>
Thu, 20 Mar 2025 15:10:18 +0000 (16:10 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 21 Mar 2025 16:46:08 +0000 (17:46 +0100)
Add a special error code for when the guest agent returned a failure
message.

Allow management applications to deterministically detect failure of the
guest agent command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
include/libvirt/virterror.h
src/util/virerror.c

index 7a2cc2b4bd404c1461c61a45deb08692ad26fd46..f02da046a3360a3b03b1a75174630de012ba25bb 100644 (file)
@@ -351,6 +351,8 @@ typedef enum {
     VIR_ERR_NO_NETWORK_METADATA = 111,  /* Network metadata is not present (Since: 9.7.0) */
     VIR_ERR_AGENT_COMMAND_TIMEOUT = 112,/* guest agent didn't respond to a non-sync
                                            command within timeout (Since: 11.2.0) */
+    VIR_ERR_AGENT_COMMAND_FAILED = 113, /* guest agent responded with failure
+                                           to a command (Since: 11.2.0) */
 
 # ifdef VIR_ENUM_SENTINELS
     VIR_ERR_NUMBER_LAST /* (Since: 5.0.0) */
index f89bfbc530abaca0605f194dac691c5c2d2ee0db..abb014b522b40ff61b01b2914b481b1bf4b14d2b 100644 (file)
@@ -1293,6 +1293,9 @@ static const virErrorMsgTuple virErrorMsgStrings[] = {
     [VIR_ERR_AGENT_COMMAND_TIMEOUT] = {
         N_("guest agent command timed out"),
         N_("guest agent command timed out: %1$s") },
+    [VIR_ERR_AGENT_COMMAND_FAILED] = {
+        N_("guest agent command failed"),
+        N_("guest agent command failed: %1$s") },
 };
 
 G_STATIC_ASSERT(G_N_ELEMENTS(virErrorMsgStrings) == VIR_ERR_NUMBER_LAST);