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.
Description of problem:
In split daemon mode, the network hook doesn't work well when the vm with an interface was shutdown by issuing "shutdown" command in the guest.
Version-Release number of selected component (if applicable):
libvirt-7.7.0-3.el9.x86_64
qemu-kvm-6.1.0-3.el9.x86_64
How reproducible:
Always
Steps to Reproduce:
1. In split daemon mode, config the network hook in /etc/libvirt/hooks/network.
#!/bin/bash
echo "$0" "$@" >> /tmp/network.log
exit 0
and change the file mode - "chmod +x network"
2. Start a domain with an interface and check /tmp/network.log
/etc/libvirt/hooks/network default port-created begin -
2. Login the console of the vm and run "shutdown 0".
3. Check the log file and there is no expected log like
/etc/libvirt/hooks/network default port-deleted begin -
Actual results:
No expected log after step2 -
/etc/libvirt/hooks/network default port-created begin -
Expected results:
Add below log to log file -
/etc/libvirt/hooks/network default port-deleted begin -
Additional info:
1.In split daemon mode, shutdown the vm with "virsh destroy vm", the log can be found in the file.
2.In a monolithic mode, run "shutdown 0" in the guest, the log can be found.
Yes, this is a genuine bug. The problem is that virtqemud fails to connect to virtnetworkd thus the latter doesn't run hook scripts. It's just a coincidence that the TAP device disappears (because QEMU that had it open is gone). What I'm seeing is that in qemuProcessStop() the virGetConnectNetwork() fails and it does so because virIdentityGetCurrent() in virGetConnectGeneric() returned NULL. This is understandable because this whole code runs in a separate thread (per vm thread for processing events) and thus has no identity set (identity is stored in a thread local store). Maybe setting the identity would help, but it needs to be done carefully so that the identity is not leaked when the thread exits.
Using upstream libvirt v7.9.0-rc1-3-g775de86975 with the above patch &qemu-6.1.0-9.fc36.x86_64
1. In split daemon mode, config the network hook in /etc/libvirt/hooks/network.
#!/bin/bash
echo "$0" "$@" >> /tmp/network.log
exit 0
and change the file mode - "chmod +x network"
2. Start a domain with an interface and check /tmp/network.log
/etc/libvirt/hooks/network default port-created begin -
3. Login the console of the vm and run "shutdown 0".
4. Check the log file and the below expected log is recorded
/etc/libvirt/hooks/network default port-deleted begin -
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 (new packages: libvirt), 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/RHBA-2022:2390