提交 d934bd0a 编写于 作者: A Alexander Todorov 提交者: Eric Blake

libvirt-guests: implement START_DELAY

Allow libvirt-guests to stage a delay between guest startups,
to avoid system load caused by back-to-back startup.
上级 e6923526
...@@ -165,6 +165,7 @@ Patches have also been contributed by: ...@@ -165,6 +165,7 @@ Patches have also been contributed by:
Thibault VINCENT <thibault.vincent@smartjog.com> Thibault VINCENT <thibault.vincent@smartjog.com>
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Jesse Cook <code.crashenx@gmail.com> Jesse Cook <code.crashenx@gmail.com>
Alexander Todorov <atodorov@otb.bg>
[....send patches to get your name here....] [....send patches to get your name here....]
......
...@@ -42,6 +42,7 @@ URIS=default ...@@ -42,6 +42,7 @@ URIS=default
ON_BOOT=start ON_BOOT=start
ON_SHUTDOWN=suspend ON_SHUTDOWN=suspend
SHUTDOWN_TIMEOUT=0 SHUTDOWN_TIMEOUT=0
START_DELAY=0
test -f "$sysconfdir"/sysconfig/libvirt-guests && test -f "$sysconfdir"/sysconfig/libvirt-guests &&
. "$sysconfdir"/sysconfig/libvirt-guests . "$sysconfdir"/sysconfig/libvirt-guests
...@@ -141,6 +142,7 @@ start() { ...@@ -141,6 +142,7 @@ start() {
return 0 return 0
fi fi
isfirst=true
while read uri list; do while read uri list; do
configured=false configured=false
set -f set -f
...@@ -165,6 +167,11 @@ start() { ...@@ -165,6 +167,11 @@ start() {
if "$guest_running"; then if "$guest_running"; then
gettext "already active"; echo gettext "already active"; echo
else else
if "$isfirst"; then
isfirst=false
else
sleep $START_DELAY
fi
retval run_virsh "$uri" start "$name" >/dev/null && \ retval run_virsh "$uri" start "$name" >/dev/null && \
gettext "done"; echo gettext "done"; echo
fi fi
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
# libvirtd # libvirtd
#ON_BOOT=start #ON_BOOT=start
# number of seconds to wait between each guest start
#START_DELAY=0
# action taken on host shutdown # action taken on host shutdown
# - suspend all running guests are suspended using virsh managedsave # - suspend all running guests are suspended using virsh managedsave
# - shutdown all running guests are asked to shutdown. Please be careful with # - shutdown all running guests are asked to shutdown. Please be careful with
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册