What were you trying to do that didn't work?
Detach virtio disk with iommu=on from VM (after there is also virtio interface attached) - depends on order of attach/detach
this can be also tested by run:
What is the impact of this issue to you?
Disk & interface not detached, VM will not stop. and has to be destroyed
Please provide the package NVR for which the bug is seen:
kernel-5.14.0-643.el9.aarch64
libvirt-11.9.0-1.el9.aarch64
qemu-kvm-10.1.0-5.el9.aarch64
How reproducible is this bug?:
100%
Steps to reproduce
in separated terminal watch events:
while true; do virsh event --loop --all --timestamp; sleep 1; done
Steps:
- define & start vm based on attached xml, wait for start
virsh define avocado.xml
2. prepare image for disk:
qemu-img create -f qcow2 /tmp/test.qcow2 200M
3.attach virtio disk
virsh attach-device vm1 /tmp/dev_obj.xml
<disk type="file" device="disk"> <driver name="qemu" type="qcow2" iommu="on" /> <source file="/tmp/test.qcow2" index="2" /> <backingStore /> <target dev="vdb" bus="virtio" /> <alias name="virtio-disk1" /> <address type="pci" domain="0x0000" bus="0x14" slot="0x00" function="0x0" /> </disk>
4. attach interface
virsh attach-device vm1 /tmp/iface_obj.xml
<interface type="network"> <model type="virtio" /> <driver name="vhost" iommu="on" /> <source network="default" /> <address type="pci" bus="0x13" /> </interface>
5. detach disk
(optional ... detach iface, shutdown vm)
Expected results:
There is event triggered
There is event triggered
disk is detached and no more in the XML
(if iface is detached - event is also there, iface no more in xml, and user is able to shutdown the VM
Actual results
no event
disk still in xml
(the iface will still in xml,
and vm not shutdown)
Additional information:
- if the order is "nested" i.e.
attach dev_obj,
attach iface_obj,
detach iface_obj,
detach dev_obj, the behavior is correct - in the VM the lsblk after the device-detach will not show the vdb row
- shutdown console info is in the shutdown.log file
- no error visible in virtqemud.log
The test is not failing on x86_64