From 7d7161c99c1bd697767b61e3762c77357465f82fd1cc37eb7875dffc0a6501ed Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 22 Dec 2015 02:31:20 +0000 Subject: [PATCH] In an upgrade scenario we must explicitly enable virtlockd/virtlogd sockets, if libvirtd is already enabled and start them if libvirtd is running, otherwise the qemu driver will fail to start guests. - spec: perform one-time enable and start of virtlogd.socket when upgrading from libvirt < 1.3.0. Inspired by upstream libvirt.git commit da054f35. OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=506 --- libvirt.changes | 7 +++++++ libvirt.spec | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/libvirt.changes b/libvirt.changes index a0f5ef2..7a73f95 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Dec 22 02:21:44 UTC 2015 - jfehlig@suse.com + +- spec: perform one-time enable and start of virtlogd.socket when + upgrading from libvirt < 1.3.0. Inspired by upstream libvirt.git + commit da054f35. + ------------------------------------------------------------------- Fri Dec 18 16:08:37 UTC 2015 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index e8a2249..e52c2d9 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -1445,6 +1445,25 @@ fi %endif %insserv_cleanup +# In upgrade scenario we must explicitly enable virtlockd/virtlogd +# sockets, if libvirtd is already enabled and start them if +# libvirtd is running, otherwise you'll get failures to start +# guests +%triggerpostun daemon -- libvirt-daemon < 1.3.0 +if [ $1 -ge 1 ] ; then + %if %{with_systemd} + /usr/bin/systemctl is-enabled libvirtd.service 1>/dev/null 2>&1 && + /usr/bin/systemctl enable virtlogd.socket || : + /usr/bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 && + /usr/bin/systemctl start virtlogd.socket || : + %else + /sbin/chkconfig libvirtd 1>/dev/null 2>&1 && + /sbin/chkconfig virtlogd on || : + /sbin/service libvirtd status 1>/dev/null 2>&1 && + /sbin/service virtlogd start || : + %endif +fi + %if %{with_network} %post daemon-config-network