Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 640702 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 - correction
libvirtd-guests-patch (text/plain), 2.13 KB, created by
Ian Pickworth
on 2020-05-21 08:13:54 UTC
(
hide
)
Description:
libvirt-guests patch to wait for connections - correction
Filename:
MIME Type:
Creator:
Ian Pickworth
Created:
2020-05-21 08:13:54 UTC
Size:
2.13 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..e672ad9 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,47 @@ libvirtd_net_stop() { > fi > } > >+libvirtd_connect_wait() { >+ # Does up to LIBVIRT_CONWAIT connect attempts >+ # Fails if cannot connect >+ # Exits as soon as a successful connection is made >+ >+ local hvuri=$1 >+ local counter=${LIBVIRT_CONWAIT} >+ >+ # Since we call virsh directly, repeat the do_virsh check >+ # if unset, default to qemu >+ [ -z ${hvuri} ] && hvuri="qemu:///system" >+ # if only qemu was supplied then correct the value >+ [ "xqemu" = x${hvuri} ] && hvuri="qemu:///system" >+ >+ einfo " Checking connection to ${hvuri} ..." >+ >+ while [ ${counter} -gt 0 ]; do >+ virsh -c ${hvuri} connect &>/dev/null >+ if [ $? -ne 0 ]; then >+ counter=$((${counter} - 1)) >+ printf "." >+ sleep 1 >+ else >+ counter=0 >+ fi >+ done >+ virsh -c ${hvuri} connect &>/dev/null >+ if [ $? -ne 0 ]; then >+ eerror "Failed to connect to '${hvuri}'. Domains may not start." >+ else >+ einfo " Connection to ${hvuri} OK" >+ 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