]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: guest-agent-timeout: set default value for optional argument
authorTomáš Golembiovský <tgolembi@redhat.com>
Fri, 21 Aug 2020 12:34:51 +0000 (14:34 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 24 Aug 2020 08:08:06 +0000 (10:08 +0200)
The timeout argument for guest-agent-timeout is optional but it did not
have proper default value specified. Also update the virsh man page
accordingly.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
docs/manpages/virsh.rst
tools/virsh-domain.c

index 5731656b1ddeeaac364ae36fb43279b284d5d1a6..199c221204e62d9477bf76ec5791a83046cc708a 100644 (file)
@@ -2631,15 +2631,16 @@ guest-agent-timeout
 
 .. code-block::
 
-   guest-agent-timeout domain --timeout value
+   guest-agent-timeout domain [--timeout value]
 
 Set how long to wait for a response from guest agent commands. By default,
 agent commands block forever waiting for a response. ``value`` must be a
 positive value (wait for given amount of seconds) or one of the following
 values:
 
-* -2 - block forever waiting for a result,
-* -1 - reset timeout to the default value,
+* -2 - block forever waiting for a result (used when --timeout is omitted),
+* -1 - reset timeout to the default value (currently defined as 5 seconds in
+  libvirt daemon),
 * 0 - do not wait at all,
 
 
index 286cf79671f9814d859754b4b1ed3f580dacb0f0..1f3a549d9ab0daf5aa4df640845ba6bddca26f8d 100644 (file)
@@ -14207,7 +14207,7 @@ static bool
 cmdGuestAgentTimeout(vshControl *ctl, const vshCmd *cmd)
 {
     virDomainPtr dom = NULL;
-    int timeout;
+    int timeout = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK;
     const unsigned int flags = 0;
     bool ret = false;