mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
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.
This commit is contained in:
parent
e692352689
commit
d934bd0a58
1
AUTHORS
1
AUTHORS
@ -165,6 +165,7 @@ Patches have also been contributed by:
|
||||
Thibault VINCENT <thibault.vincent@smartjog.com>
|
||||
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
|
||||
Jesse Cook <code.crashenx@gmail.com>
|
||||
Alexander Todorov <atodorov@otb.bg>
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
||||
|
@ -42,6 +42,7 @@ URIS=default
|
||||
ON_BOOT=start
|
||||
ON_SHUTDOWN=suspend
|
||||
SHUTDOWN_TIMEOUT=0
|
||||
START_DELAY=0
|
||||
|
||||
test -f "$sysconfdir"/sysconfig/libvirt-guests &&
|
||||
. "$sysconfdir"/sysconfig/libvirt-guests
|
||||
@ -141,6 +142,7 @@ start() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
isfirst=true
|
||||
while read uri list; do
|
||||
configured=false
|
||||
set -f
|
||||
@ -165,6 +167,11 @@ start() {
|
||||
if "$guest_running"; then
|
||||
gettext "already active"; echo
|
||||
else
|
||||
if "$isfirst"; then
|
||||
isfirst=false
|
||||
else
|
||||
sleep $START_DELAY
|
||||
fi
|
||||
retval run_virsh "$uri" start "$name" >/dev/null && \
|
||||
gettext "done"; echo
|
||||
fi
|
||||
|
@ -10,6 +10,9 @@
|
||||
# libvirtd
|
||||
#ON_BOOT=start
|
||||
|
||||
# number of seconds to wait between each guest start
|
||||
#START_DELAY=0
|
||||
|
||||
# action taken on host shutdown
|
||||
# - suspend all running guests are suspended using virsh managedsave
|
||||
# - shutdown all running guests are asked to shutdown. Please be careful with
|
||||
|
Loading…
x
Reference in New Issue
Block a user