Bug 2013573
Summary: | the network hook doesn't work well by "issuing shutdown" in split daemon mode | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Jing Qi <jinqi> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
libvirt sub component: | General | QA Contact: | Jing Qi <jinqi> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | medium | ||
Priority: | unspecified | CC: | jdenemar, lmen, mprivozn, virt-maint, xuzhang |
Version: | 9.0 | Keywords: | Regression, Triaged, Upstream |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-7.9.0-1.el9 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-05-17 12:45:32 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | 7.9.0 |
Embargoed: |
Description
Jing Qi
2021-10-13 09:44:33 UTC
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. Oh, my bad, the thread I'm talking about is not per VM; so we have to do something more clever. Patches proposed upstream: https://listman.redhat.com/archives/libvir-list/2021-October/msg01020.html Merged upstream: efc1ccc75b qemu: Set "qemu-event" thread identity 0c8f1aeddf virthreadpool: Allow setting identity for workers v7.9.0-rc1-5-gefc1ccc75b 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 - Verified with libvirt-7.9.0-1.el9.x86_64 & qemu-kvm-6.1.0-6.el9.x86_64 Steps are the same as comments 5. 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 |