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:
Detaching ('virsh detach-device-alias') shmem returns failure while actually succeeds in dumpxml of VM
Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.12.0-10.el7.x86_64
kernel-3.10.0-933.el7.x86_64
libvirt-4.5.0-6.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Prepare a shutdown VM without shmem conf and shmem.xml file
# virsh domstate test7.6
shut off
# virsh dumpxml test7.6 --inactive |grep shmem
No output
# cat shmem.xml
<shmem name='my_shmem0'>
<model type='ivshmem-plain'/>
<size unit='M'>4</size>
<alias name='ua-8a97238f-0eb4-4e94-87bf-3e878b138749'/>
</shmem>
2. Start VM and hot-plug shmem.xml to VM
# virsh start test7.6
Domain test7.6 started
# virsh attach-device test7.6 shmem.xml
Device attached successfully
# virsh dumpxml test7.6 |grep shmem -A6
<shmem name='my_shmem0'>
<model type='ivshmem-plain'/>
<size unit='M'>4</size>
<alias name='ua-8a97238f-0eb4-4e94-87bf-3e878b138749'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</shmem>
3. Detach shmem from VM
# virsh detach-device-alias test7.6 ua-8a97238f-0eb4-4e94-87bf-3e878b138749
error: Failed to detach device with alias ua-8a97238f-0eb4-4e94-87bf-3e878b138749
error: internal error: unable to execute QEMU command 'object-del': object 'shmmem-ua-8a97238f-0eb4-4e94-87bf-3e878b138749' is in use, can not be deleted
# virsh dumpxml test7.6 |grep shmem -A6
No output
Actual result:
As step-3 shows
Expected result:
Once the virsh cmd returns failure, shmem xml conf should not disappear in dumpxml of VM
Additional info:
>>>>>>>> In Step-3, the qmp info is as following:
96.073 > 0x7f721c018720 {"execute":"device_del","arguments":{"id":"ua-8a97238f-0eb4-4e94-87bf-3e878b138749"},"id":"libvirt-24"}
96.076 < 0x7f721c018720 {"return": {}, "id": "libvirt-24"}
96.076 > 0x7f721c018720 {"execute":"object-del","arguments":{"id":"shmmem-ua-8a97238f-0eb4-4e94-87bf-3e878b138749"},"id":"libvirt-25"}
96.079 < 0x7f721c018720 {"id": "libvirt-25", "error": {"class": "GenericError", "desc": "object 'shmmem-ua-8a97238f-0eb4-4e94-87bf-3e878b138749' is in use, can not be deleted"}} (libvirt receives the event from qemu.)
96.092 ! 0x7f721c018720 {"timestamp": {"seconds": 1534483936, "microseconds": 767944}, "event": "DEVICE_DELETED", "data": {"device": "ua-8a97238f-0eb4-4e94-87bf-3e878b138749", "path": "/machine/peripheral/ua-8a97238f-0eb4-4e94-87bf-3e878b138749"}}
96.093 > 0x7f721c018720 {"execute":"object-del","arguments":{"id":"shmmem-ua-8a97238f-0eb4-4e94-87bf-3e878b138749"},"id":"libvirt-26"}
96.096 < 0x7f721c018720 {"return": {}, "id": "libvirt-26"}
>>>>>>>> In Step-3, detaching the shmem device by 'virsh detach-device' can succeed
# virsh detach-device test7.6 shmem.xml
Device detached successfully
# virsh dumpxml test7.6 |grep "<shmem" -A6
No output
Fixed upstream:
commit 69c20e1090059d8b359fdd435e8ba50db7269be1
Author: Peter Krempa <pkrempa>
Date: Fri Aug 17 09:11:34 2018 +0200
qemu: hotplug: Fix asynchronous unplug of 'shmem'
commit 5c81c342a7 forgot to skip the detaching of the shmem backend
when async unplug is requested which meant that we've tried to unplug
the backend prior to delivery of the DEVICE_DELETED event.
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-2018:3113
Description of problem: Detaching ('virsh detach-device-alias') shmem returns failure while actually succeeds in dumpxml of VM Version-Release number of selected component (if applicable): qemu-kvm-rhev-2.12.0-10.el7.x86_64 kernel-3.10.0-933.el7.x86_64 libvirt-4.5.0-6.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Prepare a shutdown VM without shmem conf and shmem.xml file # virsh domstate test7.6 shut off # virsh dumpxml test7.6 --inactive |grep shmem No output # cat shmem.xml <shmem name='my_shmem0'> <model type='ivshmem-plain'/> <size unit='M'>4</size> <alias name='ua-8a97238f-0eb4-4e94-87bf-3e878b138749'/> </shmem> 2. Start VM and hot-plug shmem.xml to VM # virsh start test7.6 Domain test7.6 started # virsh attach-device test7.6 shmem.xml Device attached successfully # virsh dumpxml test7.6 |grep shmem -A6 <shmem name='my_shmem0'> <model type='ivshmem-plain'/> <size unit='M'>4</size> <alias name='ua-8a97238f-0eb4-4e94-87bf-3e878b138749'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </shmem> 3. Detach shmem from VM # virsh detach-device-alias test7.6 ua-8a97238f-0eb4-4e94-87bf-3e878b138749 error: Failed to detach device with alias ua-8a97238f-0eb4-4e94-87bf-3e878b138749 error: internal error: unable to execute QEMU command 'object-del': object 'shmmem-ua-8a97238f-0eb4-4e94-87bf-3e878b138749' is in use, can not be deleted # virsh dumpxml test7.6 |grep shmem -A6 No output Actual result: As step-3 shows Expected result: Once the virsh cmd returns failure, shmem xml conf should not disappear in dumpxml of VM Additional info: >>>>>>>> In Step-3, the qmp info is as following: 96.073 > 0x7f721c018720 {"execute":"device_del","arguments":{"id":"ua-8a97238f-0eb4-4e94-87bf-3e878b138749"},"id":"libvirt-24"} 96.076 < 0x7f721c018720 {"return": {}, "id": "libvirt-24"} 96.076 > 0x7f721c018720 {"execute":"object-del","arguments":{"id":"shmmem-ua-8a97238f-0eb4-4e94-87bf-3e878b138749"},"id":"libvirt-25"} 96.079 < 0x7f721c018720 {"id": "libvirt-25", "error": {"class": "GenericError", "desc": "object 'shmmem-ua-8a97238f-0eb4-4e94-87bf-3e878b138749' is in use, can not be deleted"}} (libvirt receives the event from qemu.) 96.092 ! 0x7f721c018720 {"timestamp": {"seconds": 1534483936, "microseconds": 767944}, "event": "DEVICE_DELETED", "data": {"device": "ua-8a97238f-0eb4-4e94-87bf-3e878b138749", "path": "/machine/peripheral/ua-8a97238f-0eb4-4e94-87bf-3e878b138749"}} 96.093 > 0x7f721c018720 {"execute":"object-del","arguments":{"id":"shmmem-ua-8a97238f-0eb4-4e94-87bf-3e878b138749"},"id":"libvirt-26"} 96.096 < 0x7f721c018720 {"return": {}, "id": "libvirt-26"} >>>>>>>> In Step-3, detaching the shmem device by 'virsh detach-device' can succeed # virsh detach-device test7.6 shmem.xml Device detached successfully # virsh dumpxml test7.6 |grep "<shmem" -A6 No output