Red Hat Bugzilla – Bug 831049
Update libvirtd manpage to describe how --timeout works & its usage limitations
Last modified: 2013-02-21 02:17:00 EST
Description of problem: For now, when we run libvirtd by root user in the foreground, the timeout option can not come into force if there are some active objects, such as running guests, active pools or virtual networks. In fact, both 'default' pool and 'default' net are autostart, so unless we set autostart=false for them, they will always start when run libvirtd in the foregroud, then timeout option will never work. So we need to get rid of the impractical design. Version-Release number of selected component (if applicable): libvirt-0.9.10-21.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. Stop all started guests, pools and networks. And don't change the autostart flag for pools and networks. 2. #service libvirtd stop 3. #libvirtd -t 2 Actual results: Step3, libvirtd can not exit after 2 seconds. Expected results: get rid of the impractical design for libvirtd timeout option. Additional info:
This is working entirely as designed. The timeout option is *supposed* to take account of any running resources, so if you autostart things, it will not shutdown. The timeout option is primarily intended for use with the non-privileged libvirtd when it has been auto-spawned by a client app.
(In reply to comment #1) > This is working entirely as designed. The timeout option is *supposed* to > take account of any running resources, so if you autostart things, it will > not shutdown. The timeout option is primarily intended for use with the > non-privileged libvirtd when it has been auto-spawned by a client app. Thanks, i see. So, if we need update the man page to give a detail explanation for timeout option? For now: #man libvirtd <snip> -t, --timeout SECONDS Exit after timeout period (in seconds) expires. </snip>
I agree with Dan that the behavior is correct as designed. It does however seem that confusion arises pretty much every time someone tries to use this feature, so perhaps some additional documentation in the manpage will help clarify things. I'm reopening to track the manpage addition.
how to test it: 1 start libvirtd /usr/sbin/libvirtd --timeout=2 2 check registered drivers, ensure no active resouces. virsh net-list --all virsh pool-list --all virsh nwfilter-list virsh -c qemu:///system list --all virsh -c lxc:/// list --all virsh -c uml:///system list --all for these registered drivers: network, storage, nwfilter, qemu, lxc, uml, libxl 3, When all active resource, for example, domain is shutdown, the libvirtd will stop automatically.
patch sent to upstream https://www.redhat.com/archives/libvir-list/2012-July/msg01393.html
commit a077c562f60aa42cb9a665f5f596bb1d2cae2550 Author: Guannan Ren <gren@redhat.com> Date: Thu Jul 26 00:22:53 2012 +0800 doc: add more description on libvirtd option timeout
(In reply to comment #4) > how to test it: > 1 start libvirtd > /usr/sbin/libvirtd --timeout=2 > 2 check registered drivers, ensure no active resouces. > virsh net-list --all > virsh pool-list --all > virsh nwfilter-list > virsh -c qemu:///system list --all > virsh -c lxc:/// list --all > virsh -c uml:///system list --all > > for these registered drivers: network, storage, nwfilter, qemu, lxc, uml, > libxl > > 3, When all active resource, for example, domain is shutdown, the libvirtd > will stop automatically. This test already passed before, and check the manpage of libvirtd, can find more description on libvirtd option timeout For libvirt-0.9.13-3.el6.x86_64 #man libvirtd ------ -t, --timeout SECONDS Exit after timeout period (in seconds) expires. ------ For libvirt-0.10.0-0rc0.el6.x86_64 #man libvirtd ------ -t, --timeout SECONDS Exit after timeout period (in seconds) elapse with no client connections or registered resources. Be aware that resources such as autostart networks will result in never reaching the timeout, even when there are no client connections. ------ So move this bug to verify.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0276.html