Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionMartin Kletzander
2017-02-03 07:47:03 UTC
+++ This bug was initially created as a clone of Bug #1384007 +++
Description of problem:
When a libvirt managed qemu process gets signaled to quit, libvirt reports the same lifecylce event as if the guest operating system shuts down.
Version-Release number of selected component (if applicable):
libvirt-daemon-1.2.17-13.el7_2.6.x86_64
How reproducible:
Always
Steps to Reproduce:
1. Create a virtual machine with a guest operating system (e.g. Linux)
2. Start the virtual machine
3. virsh -r event <DOMID> --all
4. Get PID for the qemu process of that VM
5. kill -15 $PID
Actual results:
event 'lifecycle' for domain <DOMAINNAME>: Shutdown Finished
Expected results:
A different event detail that allows to distinguish a shutdown from within the Virtual Machine from a process quit via signal from the hypervisor side.
Additional info:
--- Additional comment from Red Hat Bugzilla Rules Engine on 2016-10-12 07:27:15 EDT ---
Since this bug report was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
--- Additional comment from Martin Kletzander on 2017-02-03 02:38:25 EST ---
Just a quick test for the two cases shows:
On 'virsh shutdown domain' QEMU sends us:
SHUTDOWN
STOP
SHUTDOWN
whether on 'kill $domain_pid' we get:
SHUTDOWN
So there are two problems. First is that the difference comes *after* the point where we consider the domain to be shut down (and we have already emitted the libvirt event). More importantly, this is not guaranteed to happen (I just tried it once) and none of the differences (the stop or the second shutdown) make sense after SHUTDOWN was recieved.
The only way to differentiate this would be by adding information to the event in QEMU. So I'm cloning this BZ to QEMU for the requested support.
On the qemu side, the QMP command 'system_powerdown' (invoked by 'virsh shutdown' if the guest agent is not present) sets the global powerdown_requested, which in turn triggers a call to qemu_system_powerdown(), and that sends the first qemu_event_send_powerdown() event seen by libvirt as POWERDOWN prior to iterating through any registered powerdown_notifiers; one of those notifiers then results in the ACPI signal seen by the guest; the guest (normally) reacts by shutting down and eventually triggers the next round of events sent by qemu when qemu_system_shutdown_request() is reached. Or, if the guest agent is active, system_powerdown is skipped, but it is still a guest action that triggers qemu_system_shutdown_request(). Either way, the global shutdown_requested is set to 1, although shutdown_signal is left unchanged.
Meanwhile, the SIGTERM handler termsig_handler() calls qemu_system_killed(), which sets the global shutdown_requested but also shutdown_signal, and in turn lets main_loop_should_exit() send qemu_event_send_shutdown() seen as a SHUTDOWN event by libvirt.
Ultimately, since the global shutdown_requested is used through both code paths, the only thing that qemu could do differently is to enhance the SHUTDOWN event that it emits to report the presence of a shutdown signal, based on whether the global shutdown_signal was set at the time the event is emitted. Such a change is a new feature, though, so it would NOT make qemu 2.9. I will propose it upstream, and it could be backported to RHEV if upstream agrees to it, but then libvirt still has to have a patch to be taught to make use of that bit of information.
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.
https://access.redhat.com/errata/RHSA-2017:2392
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.
https://access.redhat.com/errata/RHSA-2017:2392
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.
https://access.redhat.com/errata/RHSA-2017:2392
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.
https://access.redhat.com/errata/RHSA-2017:2392
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.
https://access.redhat.com/errata/RHSA-2017:2392
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.
https://access.redhat.com/errata/RHSA-2017:2392