[meta-virtualization] [PATCH] libvirt: pass correct args when start libvirtd

Mark Asselstine mark.asselstine at windriver.com
Fri Sep 11 07:42:16 PDT 2015


When systemd starts libvirtd we want to make sure we pass the correct
arguments to run the daemon. If we fail to do so the libvirtd service
will restart about once a minute and not allow for VMs to properly be
instantiated. libvirtd now runs with the same args as when we use
sysvinit.

Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
---
 recipes-extended/libvirt/libvirt_1.2.17.bb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/recipes-extended/libvirt/libvirt_1.2.17.bb b/recipes-extended/libvirt/libvirt_1.2.17.bb
index 6f269f9..06cb51b 100644
--- a/recipes-extended/libvirt/libvirt_1.2.17.bb
+++ b/recipes-extended/libvirt/libvirt_1.2.17.bb
@@ -222,6 +222,11 @@ do_install_append() {
 	    mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d
 	fi
 
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+	    # This variable is used by libvirtd.service to start libvirtd in the right mode
+	    sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd
+	fi
+
 	# The /var/run/libvirt directories created by the Makefile
 	# are wiped out in volatile, we need to create these at boot.
 	rm -rf ${D}${localstatedir}/run
-- 
2.1.4



More information about the meta-virtualization mailing list