Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 640570 Details for
Bug 723494
app-emulation/libvirt-6.2.0-r2: update to openrc init scripts breaks libvirt-guests - timing issue
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
libvirt-guests patch to wait for connections
libvirt-guests-diff.patch (text/plain), 1.93 KB, created by
Ian Pickworth
on 2020-05-20 14:45:52 UTC
(
hide
)
Description:
libvirt-guests patch to wait for connections
Filename:
MIME Type:
Creator:
Ian Pickworth
Created:
2020-05-20 14:45:52 UTC
Size:
1.93 KB
patch
obsolete
>diff --git a/files/libvirt-guests.confd b/files/libvirt-guests.confd >index ed2ce58..d794e85 100644 >--- a/files/libvirt-guests.confd >+++ b/files/libvirt-guests.confd >@@ -66,3 +66,12 @@ > # NATed network for you. Valid values: 'yes' or 'no' > > #LIBVIRT_NET_SHUTDOWN="yes" >+ >+ >+# LIBVIRT_CONWAIT >+# The timeout, in seconds, to wait for a connection to LIBVIRT_URIS >+# Valid values are any integer greater than or equal to 0 >+# 0 means there will be no wait >+# >+#LIBVIRT_CONWAIT=5 >+ >diff --git a/files/libvirt-guests.init-r4 b/files/libvirt-guests.init-r4 >index b29f04c..01b718f 100644 >--- a/files/libvirt-guests.init-r4 >+++ b/files/libvirt-guests.init-r4 >@@ -18,6 +18,10 @@ esac > # default to 500 seconds > [ -z ${LIBVIRT_MAXWAIT} ] && LIBVIRT_MAXWAIT=500 > >+# default to 5 seconds >+[ -z ${LIBVIRT_CONWAIT} ] && LIBVIRT_CONWAIT=5 >+ >+ > gueststatefile="/var/lib/libvirt/libvirt-guests.state" > netstatefile="/var/lib/libvirt/libvirt-net.state" > >@@ -165,16 +169,43 @@ libvirtd_net_stop() { > fi > } > >+libvirtd_connect_wait() { >+ # Does up to LIBVIRT_CONWAIT connect attemtpts >+ # Exits as soon as a successful connection is made >+ >+ local hvuri=$1 >+ local counter=${LIBVIRT_CONWAIT} >+ local ruri >+ >+ einfo " Checking connection to ${hvuri} ..." >+ >+ while [ ${counter} -gt 0 ] ; do >+ ruri=$(do_virsh "${hvuri}" uri) >+ counter=$((${counter} - 1)) >+ if [ "${hvuri}" = "${ruri}" ]; then >+ counter=0 >+ else >+ counter=$((${counter} - 1)) >+ printf "." >+ sleep 1 >+ fi >+ >+ done >+ ruri=$(do_virsh "${hvuri}" uri) >+ if [ "${hvuri}" = "${ruri}" ]; then >+ einfo " Connection to ${hvuri} OK" >+ else >+ eerror "Failed to connect to '${hvuri}'. Domains may not start." >+ fi >+} >+ > start() { > local uri= > local uuid= > local name= > > for uri in ${LIBVIRT_URIS}; do >- do_virsh "${uri}" connect >- if [ $? -ne 0 ]; then >- eerror "Failed to connect to '${uri}'. Domains may not start." >- fi >+ libvirtd_connect_wait ${uri} > done > > [ ! -e "${netstatefile}" ] && touch "${netstatefile}"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 723494
: 640570 |
640702