Bug 2036669
| Summary: | DEVICE_DELETED event is not delivered for device frontend if -device is configured via JSON | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Peter Krempa <pkrempa> |
| Component: | qemu-kvm | Assignee: | Kevin Wolf <kwolf> |
| qemu-kvm sub component: | PCI | QA Contact: | Yiqian Wei <yiwei> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | unspecified | CC: | chayang, coli, fjin, jinqi, jinzhao, jtomko, juzhang, kchamart, kwolf, lcheng, lijin, lizhu, mark, meili, mrezanin, ngu, qinwang, smitterl, virt-maint, yanghliu, yiwei, zhenyzha, zhguo |
| Version: | 9.0 | Keywords: | Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | qemu-kvm-6.2.0-5.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-05-17 12:25:11 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: | |
| Embargoed: | |||
Kevin, please have a look at this one. The original libvirt bug report: https://bugzilla.redhat.com/show_bug.cgi?id=2035237 It's likely the same bug of Bug 2033279 - [wrb][qemu-kvm 6.2] The hot-unplugged device can not be hot-plugged back We met the similar issue with guest agent -
It can't really detach guest agent device in a live domain in rhel9
Version-Release number of selected component (if applicable):
libvirt-daemon-7.10.0-1.el9.x86_64
qemu-kvm-6.2.0-1.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Start a domain with guest agent configuration, below is partial from virsh dumpxml * -
channel.xml
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-2-avocado-vt-vm1/org.qemu.guest_agent.0'/>
<target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
<alias name='channel0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
2. Detach guest agent device in live domain
virsh detach-device avocado-vt-vm1 channel.xml --live
Device detached successfully
3. virsh dumpxml again -
The output still have the device above.
4. Checked the log and there is "Device 'channel0' not found" error -
2022-01-10 04:42:23.428+0000: 506525: debug : qemuDomainObjBeginJobInternal:837 : Starting job: job=modify agentJob=none asyncJob=none (vm=0x7f6364090840 name=avocado-vt-vm1, current job=none agentJob=none async=none)
2022-01-10 04:42:23.428+0000: 506525: debug : qemuDomainObjBeginJobInternal:889 : Started job: modify (async=none vm=0x7f6364090840 name=avocado-vt-vm1)
2022-01-10 04:42:23.429+0000: 506525: debug : qemuDomainObjEnterMonitorInternal:5850 : Entering monitor (mon=0x7f6364083460 vm=0x7f6364090840 name=avocado-vt-vm1)
2022-01-10 04:42:23.429+0000: 506525: debug : qemuMonitorDelDevice:2837 : devalias=channel0
2022-01-10 04:42:23.429+0000: 506525: debug : qemuMonitorDelDevice:2839 : mon:0x7f6364083460 vm:0x7f6364090840 fd:26
2022-01-10 04:42:23.429+0000: 506525: info : qemuMonitorSend:952 : QEMU_MONITOR_SEND_MSG: mon=0x7f6364083460 msg={"execute":"device_del","arguments":{"id":"channel0"},"id":"libvirt-405"}^M
fd=-1
2022-01-10 04:42:23.429+0000: 506707: info : qemuMonitorIOWrite:437 : QEMU_MONITOR_IO_WRITE: mon=0x7f6364083460 buf={"execute":"device_del","arguments":{"id":"channel0"},"id":"libvirt-405"}^M
len=75 ret=75 errno=0
2022-01-10 04:42:23.430+0000: 506707: debug : qemuMonitorJSONIOProcessLine:222 : Line [{"id": "libvirt-405", "error": {"class": "DeviceNotFound", "desc": "Device 'channel0' not found"}}]
2022-01-10 04:42:23.430+0000: 506707: info : qemuMonitorJSONIOProcessLine:241 : QEMU_MONITOR_RECV_REPLY: mon=0x7f6364083460 reply={"id": "libvirt-405", "error": {"class": "DeviceNotFound", "desc": "Device 'channel0' not found"}}
2022-01-10 04:42:23.430+0000: 506525: debug : qemuDomainObjExitMonitorInternal:5875 : Exited monitor (mon=0x7f6364083460 vm=0x7f6364090840 name=avocado-vt-vm1)
2022-01-10 04:42:23.430+0000: 506525: debug : qemuDomainDeleteDevice:133 : Detaching of device channel0 failed and no event arrived
2022-01-10 04:42:28.430+0000: 506525: debug : qemuDomainObjEnterMonitorInternal:5850 : Entering monitor (mon=0x7f6364083460 vm=0x7f6364090840 name=avocado-vt-vm1)
2022-01-10 04:42:28.430+0000: 506525: debug : qemuMonitorGetDeviceAliases:3867 : aliases=0x7f63afd55790
2022-01-10 04:42:28.430+0000: 506525: debug : qemuMonitorGetDeviceAliases:3869 : mon:0x7f6364083460 vm:0x7f6364090840 fd:26
2022-01-10 04:42:28.430+0000: 506525: info : qemuMonitorSend:952 : QEMU_MONITOR_SEND_MSG: mon=0x7f6364083460 msg={"execute":"qom-list","arguments":{"path":"/machine/peripheral"},"id":"libvirt-406"}^M
fd=-1
2022-01-10 04:42:28.430+0000: 506707: info : qemuMonitorIOWrite:437 : QEMU_MONITOR_IO_WRITE: mon=0x7f6364083460 buf={"execute":"qom-list","arguments":{"path":"/machine/peripheral"},"id":"libvirt-406"}^M
len=86 ret=86 errno=0
(In reply to Yanghang Liu from comment #4) > It's likely the same bug of Bug 2033279 - [wrb][qemu-kvm 6.2] The hot-unplugged device can not be hot-plugged back Hi Kevin, It seems that I have open a same bug against RHEL8.6 -- Bug 2033279 - [wrb][qemu-kvm 6.2] The hot-unplugged device can not be hot-plugged back Could you please help have a look at the above bug and fix this issue in RHEL8.6 as well ? QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass. (In reply to Yanghang Liu from comment #9) > Could you please help have a look at the above bug and fix this issue in > RHEL8.6 as well ? The description of bug 2033279 looks unrelated (no JSON -device, and DEVICE_DELETED is correctly delivered). However, this bug exists in 8.6, too. If you confirm that the description of the other bug is still accurate (i.e. it is indeed unrelated), you can clone this one instead. 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: qemu-kvm), 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:2307 |
Description of problem: When -device is used with a JSON object as argument, and the device in question is then removed no DEVICE_DELETED event is emitted for such device. Version-Release number of selected component (if applicable): qemu-6.2 upstream release. How reproducible: always Steps to Reproduce: 1. Configure a device via -device JSON. E.g.: -device '{"driver":"e1000","netdev":"hostnet0","id":"net0","mac":"52:54:00:f1:cd:5f","bus":"pci.0","addr":"0xc"}' \ or -device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:f1:cd:5f","bus":"pci.0","addr":"0x3"}' \ 2. Unplug the device via device_del: {"execute":"device_del","arguments":{"id":"net0"},"id":"libvirt-424"} 3. Actual results: In case of e1000, no DEVICE_DELETED event is delivered at all. For virtio-net-pci, only the virtio-backend deletion event is delivered: 2022-01-03 13:49:10.661+0000: 3074909: info : qemuMonitorJSONIOProcessLine:236 : QEMU_MONITOR_RECV_EVENT: mon=0x7fff9c1c88b0 event={"timestamp": {"seconds": 1641217750, "microseconds": 661314}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net0/virtio-backend"}} Expected results: DEVICE_DELETED events for the frontend are delivered: With: -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:f1:cd:5f,bus=pci.0,addr=0xc 2022-01-03 14:19:19.586+0000: 3116343: info : qemuMonitorJSONIOProcessLine:236 : QEMU_MONITOR_RECV_EVENT: mon=0x7fff9c1c88b0 event={"timestamp": {"seconds": 1641219559, "microseconds": 586854}, "event": "DEVICE_DELETED", "data": {"device": "net0", "path": "/machine/peripheral/net0"}} With: -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:f1:cd:5f,bus=pci.0,addr=0x3 \ 2022-01-03 13:53:36.926+0000: 3089522: info : qemuMonitorJSONIOProcessLine:236 : QEMU_MONITOR_RECV_EVENT: mon=0x7fff9c1c88b0 event={"timestamp": {"seconds": 1641218016, "microseconds": 926457}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net0/virtio-backend"}} 2022-01-03 13:53:36.977+0000: 3089522: info : qemuMonitorJSONIOProcessLine:236 : QEMU_MONITOR_RECV_EVENT: mon=0x7fff9c1c88b0 event={"timestamp": {"seconds": 1641218016, "microseconds": 977140}, "event": "DEVICE_DELETED", "data": {"device": "net0", "path": "/machine/peripheral/net0"}} Additional info: The above applies for all devices including disks and others. Network devices were picked just as an example. Note that after this is fixed, libvirt will require a new capability flag (either on 'device_add' or on 'DEVICE_DELETED') which will be used instead of 'json-cli' for detecting that we can really use the JSON syntax as for now we'll have to revert the support to make sure that libvirt works properly with qemu-6.2.