This is a quite an old (created at 2016) patch fixing an issue for at that time contemporary Fedora 23. virsh reboot returns success (yet after hanging for a while), VM is rebooted sucessfully too but then shutdown from inside guest causes reboot and not shutdown. VM has agent installed. So virsh reboot first tries to reboot VM thru the agent. The agent calls 'shutdown -r' command. Typically it returns instantly but on this distro for some reason it takes time. I did not investigate the cause but the command waits in dbus client code, probably waits for reply. The libvirt waits 60s for agent command to execute and then errors out. Next reboot API falls back to ACPI shutdown which returns successfully thus the reboot command return success too. Yet shutdown command in guest eventually successfull and guest is truly rebooted. So libvirt does not receive SHUTDOWN event and fake reboot flag which is armed on fallback path stays armed. Thus next shutdown from guest leads to reboot. The issue has 100% repro on Fedora 23. On modern distros I can't reproduce it at all. Shutdown command is asynchronous and returns immediately even if I start some service that ignores TERM signal and thus shutdown procedure waits for 90s (if I not mistaken) before sending KILL. Yet I guess it is nice to have this patch to be more robust. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Nikolay Shirokovskiy <nikolay.shirokovskiy@openvz.org>
Libvirt API for virtualization
Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
For some of these hypervisors, it provides a stateful management daemon which runs on the virtualization host allowing access to the API both by non-privileged local users and remote users.
Layered packages provide bindings of the libvirt C API into other languages including Python, Perl, PHP, Go, Java, OCaml, as well as mappings into object systems such as GObject, CIM and SNMP.
Further information about the libvirt project can be found on the website:
License
The libvirt C API is distributed under the terms of GNU Lesser General Public License, version 2.1 (or later). Some parts of the code that are not part of the C library may have the more restrictive GNU General Public License, version 2.0 (or later). See the files COPYING.LESSER
and COPYING
for full license terms & conditions.
Installation
Instructions on building and installing libvirt can be found on the website:
https://libvirt.org/compiling.html
Contributing
The libvirt project welcomes contributions in many ways. For most components the best way to contribute is to send patches to the primary development mailing list. Further guidance on this can be found on the website:
https://libvirt.org/contribute.html
Contact
The libvirt project has two primary mailing lists:
- libvirt-users@redhat.com (for user discussions)
- libvir-list@redhat.com (for development only)
Further details on contacting the project are available on the website: