1 Star 0 Fork 71

yoo/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
virsh-guest-agent-timeout-set-default-value-for-opti.patch 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
From 6545b7b8501bdbdf12cbaf2098ef4617764de591 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= <tgolembi@redhat.com>
Date: Fri, 21 Aug 2020 14:34:51 +0200
Subject: [PATCH 048/108] virsh: guest-agent-timeout: set default value for
optional argument
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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>
(cherry picked from commit c7547a16f8a30cf573a7d11d9497fca2f28d9bf3)
---
docs/manpages/virsh.rst | 7 ++++---
tools/virsh-domain.c | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index dc404ddfe8..db15cc6507 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -2622,15 +2622,16 @@ guest
.. 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,
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index b5375ebd3e..622972bdd4 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -14227,7 +14227,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;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdLUbG/libvirt.git
git@gitee.com:mdLUbG/libvirt.git
mdLUbG
libvirt
libvirt
master

搜索帮助