mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
committed by
Eric Blake
parent
e692352689
commit
d934bd0a58
1
AUTHORS
1
AUTHORS
@@ -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
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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 @@
|
|||||||
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user