Re: [PATCH] implement BOOT_TIMEOUT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello folks,
here's a second try at this wrt to Eric's comments.
BOOT_TIMEOUT changed to START_DELAY, updated wording in the conf file to better reflect what this does and added a flag to skip sleeping for the first ever started guest.


---
 tools/libvirt-guests.init.sh |    7 +++++++
 tools/libvirt-guests.sysconf |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/tools/libvirt-guests.init.sh b/tools/libvirt-guests.init.sh
index f247e5e..30f957a 100644
--- a/tools/libvirt-guests.init.sh
+++ b/tools/libvirt-guests.init.sh
@@ -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
diff --git a/tools/libvirt-guests.sysconf b/tools/libvirt-guests.sysconf
index cd58728..37b258e 100644
--- a/tools/libvirt-guests.sysconf
+++ b/tools/libvirt-guests.sysconf
@@ -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


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]