]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lib: error: Introduce 'VIR_ERR_AGENT_COMMAND_TIMEOUT'
authorPeter Krempa <pkrempa@redhat.com>
Thu, 20 Mar 2025 14:27:13 +0000 (15:27 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 21 Mar 2025 16:46:07 +0000 (17:46 +0100)
Introduce a new special error code for guest agent commands.

The error code will be specifically reported only when an actual command
(not a sync) was issued to the guest agent and the timeout time was
reached.

This will allow users and management applications to differentiate
between the cases when the sync timed out and thus there's no risk in
the agent actually having executed the command and when the actual
command was sent.

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 224eddc9e453481efa63b1a29ad81da3dbca88db..7a2cc2b4bd404c1461c61a45deb08692ad26fd46 100644 (file)
@@ -349,6 +349,8 @@ typedef enum {
     VIR_ERR_CHECKPOINT_INCONSISTENT = 109, /* checkpoint can't be used (Since: 6.10.0) */
     VIR_ERR_MULTIPLE_DOMAINS = 110,     /* more than one matching domain found (Since: 7.1.0) */
     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) */
 
 # ifdef VIR_ENUM_SENTINELS
     VIR_ERR_NUMBER_LAST /* (Since: 5.0.0) */
index 227a1824176a60fad2701e2e7575549f432f279e..f89bfbc530abaca0605f194dac691c5c2d2ee0db 100644 (file)
@@ -1290,6 +1290,9 @@ static const virErrorMsgTuple virErrorMsgStrings[] = {
     [VIR_ERR_NO_NETWORK_METADATA] = {
         N_("metadata not found"),
         N_("metadata not found: %1$s") },
+    [VIR_ERR_AGENT_COMMAND_TIMEOUT] = {
+        N_("guest agent command timed out"),
+        N_("guest agent command timed out: %1$s") },
 };
 
 G_STATIC_ASSERT(G_N_ELEMENTS(virErrorMsgStrings) == VIR_ERR_NUMBER_LAST);