Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 551854 - app-emulation/libvirt should NOT use LIBVIRTD_KVM_NET_SHUTDOWN on libvirtd restart
Summary: app-emulation/libvirt should NOT use LIBVIRTD_KVM_NET_SHUTDOWN on libvirtd re...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Highest critical (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-12 04:33 UTC by Robin Johnson
Modified: 2015-09-17 15:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2015-06-12 04:33:48 UTC
If you are simply restarting libvirtd (eg for an openssl upgrade), the VMs should be KEPT running.

Please add LIBVIRTD_KVM_RESTART as a configuration option, with a default of 'none', so that running VMs are NOT touched during a restart of libvirt.

This caused a 15 minute outage of woodpecker, as infra does automatic restarts of daemons that use deleted libraries, and the restart behavior was not intuitive.
Comment 1 Matthias Maier gentoo-dev 2015-06-14 08:46:48 UTC
The openrc init script has "reload" and "halt" as additional commands to restart and stop the daemon without touching the VMs. "restart" and "stop" honor LIBVIRTD_KVM_SHUTDOWN.

Is it possible to use "reload" instead of "restart" for infra (and specific daemons)?

Further - if we decide to change the current behavior - I'd say, reimplementing "restart" in terms of "reload" without an additional configuration option is the way to go.
Comment 2 Matthias Maier gentoo-dev 2015-06-16 09:45:25 UTC
*ping*
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2015-06-16 19:20:08 UTC
The infra case is already temporarily changed to use reload.

I think the root cause here, is should existing child processes be affected by a restart command, by default?

Make restart honor a different variable than stop, say LIBVIRTD_KVM_RESTART, then it will be trivial.
Comment 4 Matthias Maier gentoo-dev 2015-06-24 09:49:02 UTC
*libvirt-1.2.16-r1 (24 Jun 2015)

  24 Jun 2015; Matthias Maier <tamiko@gentoo.org> +files/libvirtd.confd-r5,
  +files/libvirtd.init-r15, +libvirt-1.2.16-r1.ebuild, -libvirt-1.2.16.ebuild,
  files/libvirtd.init-r14:
  provide a configuration option for domains and network on restart, bug #551854
Comment 5 Matthias Maier gentoo-dev 2015-06-24 09:50:17 UTC
This is now fixed in version 1.2.16-r1 with two new configuration options in /etc/conf.d/libvirtd, "LIBVIRTD_KVM_RESTART", and "LIBVIRTD_KVM_NET_RESTART".
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2015-07-30 19:34:24 UTC
(In reply to Robin Johnson from comment #3)
> The infra case is already temporarily changed to use reload.
> 
> I think the root cause here, is should existing child processes be affected
> by a restart command, by default?
> 
> Make restart honor a different variable than stop, say LIBVIRTD_KVM_RESTART,
> then it will be trivial.

This was done this way back in the day before OpenRC was forked off and we couldn't add extra commands. The only extra command we could use was 'reload'. 'reload' was defined as 'non-intrusive' while 'restart' was defined as 'intrusive'. We currently tell users to restart libvirtd when dealing with QEMU vulnerabilities so that they get their VMs running with a newer version of QEMU without much downtime.

The real answer is to not add yet another variable and configuration but to use the right command which is 'reload'.

This change needs to be reverted.
Comment 7 Matthias Maier gentoo-dev 2015-07-31 03:24:47 UTC
*libvirt-1.2.17-r4 (31 Jul 2015)

  31 Jul 2015; Matthias Maier <tamiko@gentoo.org> +libvirt-1.2.17-r4.ebuild,
  -files/libvirtd.confd-r6, -files/libvirtd.init-r16, -libvirt-1.2.17-r3.ebuild,
  libvirt-9999.ebuild:
  on behalf of cardoe; revert all changes made to the openrc runscripts; as per
  discussions on bug #555736 and on bug #551854
Comment 8 Matthias Maier gentoo-dev 2015-07-31 03:35:52 UTC
To clarify:

Cardoe and I have decided to split out the guest managed from the libvirtd runscipt into its own "libvirt-guests" runsript (as is already the case for the systemd unit files):

/etc/init.d/libvirtd
  - solely manages the libvirtd daemon

/etc/init.d/libvirt-guests
  - solely takes care of running guests upon restart/shutdown of the host


With that, the policy decision is obsolete. (See also bug #555736)
Comment 9 Matthias Maier gentoo-dev 2015-08-20 01:15:49 UTC
commit 75a2af9e00d8701cb3a6f201976ed9ba27bcc7d0
Author: Matthias Maier <tamiko@gentoo.org>
Date:   Wed Aug 19 20:07:43 2015 -0500

    app-emulation/libvirt: Update init scripts for 1.2.18-r2 and 9999
    
    update init scripts for 1.2.18-r2 und 9999. Drop keywords for testing due
    to major runscript change.
    
    Bugs: 551854
    Bugs: 555736
    Bugs: 558034
    
    Package-Manager: portage-2.2.20.1

commit aed11adf8c5bdff71154e1c5e0c375951d237f36
Author: Doug Goldstein <cardoe@gentoo.org>
Date:   Tue Aug 18 16:08:56 2015 -0500

    app-emulation/libvirt: break apart OpenRC init script
    
    This breaks apart the startup/shutdown of libvirtd from the
    startup/shutdown of the libvirt domains. Additionally this expands out
    the domain support to work for all the libvirtd backends instead of just
    QEMU.
    
    Signed-off-by: Doug Goldstein <cardoe@gentoo.org>
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>
Comment 10 Doug Goldstein (RETIRED) gentoo-dev 2015-09-17 15:06:29 UTC
This is fixed in 1.2.19 which is in the wild now.