Bug 2013523
Summary: | Save and restore the vm with cdrom cause the vm's cdrom tray locked | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | yalzhang <yalzhang> |
Component: | libvirt | Assignee: | khanicov |
libvirt sub component: | General | QA Contact: | Han Han <hhan> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | medium | ||
Priority: | high | CC: | fjin, hhan, jdenemar, jsuchane, khanicov, kwolf, lmen, mprivozn, pkrempa, rjoyce, smitterl, virt-maint, xuzhang |
Version: | 9.1 | Keywords: | Regression, Triaged |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-8.9.0-1.el9 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-05-09 07:26:10 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: | 8.9.0 |
Embargoed: |
Description
yalzhang@redhat.com
2021-10-13 05:33:12 UTC
Also described here: https://bugzilla.redhat.com/show_bug.cgi?id=1824722#c1 Upstream issue: https://gitlab.com/libvirt/libvirt/-/issues/301 Merged upstream as: 7356dce2b3 qemu: Refresh state after restore from a save image v8.8.0-160-g7356dce2b3 This bug was solved by mprivozn. Tested on libvirtv8.8.0-172-gf1d63048b7 qemu-7.1.0-3.fc38.x86_64: 1. Start an VM with cdrom 2. Check the cdrom status by QMP `info block` ➜ ~ virsh qemu-monitor-command rhel9 --hmp info block libvirt-2-format: /var/lib/libvirt/images/1 (raw) Attached to: /machine/peripheral/virtio-disk0/virtio-backend Cache mode: writeback libvirt-1-format: /var/lib/libvirt/images/boot.iso (raw, read-only) Attached to: scsi0-0-0-1 Removable device: locked, tray closed Cache mode: writeback Save and restore the CDROM ➜ ~ virsh save rhel9 /tmp/rhel9.save Domain 'rhel9' saved to /tmp/rhel9.save ➜ ~ virsh restore /tmp/rhel9.save Domain restored from /tmp/rhel9.save Check the Removable device status of the cdrom. Expect the same with what is before the save&restore ➜ ~ virsh qemu-monitor-command rhel9 --hmp info block libvirt-2-format: /var/lib/libvirt/images/1 (raw) Attached to: /machine/peripheral/virtio-disk0/virtio-backend Cache mode: writeback libvirt-1-format: /var/lib/libvirt/images/boot.iso (raw, read-only) Attached to: scsi0-0-0-1 Removable device: locked, tray closed Cache mode: writeback 3. Execute `eject -i off /dev/sr0` to change the locked status. And redo step2 libvirt-2-format: /var/lib/libvirt/images/1 (raw) Attached to: /machine/peripheral/virtio-disk0/virtio-backend Cache mode: writeback libvirt-1-format: /var/lib/libvirt/images/boot.iso (raw, read-only) Attached to: scsi0-0-0-1 Removable device: not locked, tray closed Cache mode: writeback Save and restore the CDROM ➜ ~ virsh save rhel9 /tmp/rhel9.save Domain 'rhel9' saved to /tmp/rhel9.save ➜ ~ virsh restore /tmp/rhel9.save Domain restored from /tmp/rhel9.save Check the Removable device status of the cdrom. Expect the same with what is before the save&restore ➜ ~ virsh qemu-monitor-command rhel9 --hmp info block libvirt-2-format: /var/lib/libvirt/images/1 (raw) Attached to: /machine/peripheral/virtio-disk0/virtio-backend Cache mode: writeback libvirt-1-format: /var/lib/libvirt/images/boot.iso (raw, read-only) Attached to: scsi0-0-0-1 Removable device: not locked, tray closed Cache mode: writeback Test as comment0 on libvirt-8.9.0-2.el9.x86_64 qemu-kvm-7.1.0-4.el9.x86_64. PASS ➜ ~ virsh qemu-monitor-command rhel-9.2 --hmp info block libvirt-3-format: /var/lib/libvirt/images/rhel-9.2.qcow2 (qcow2) Attached to: /machine/peripheral/virtio-disk0/virtio-backend Cache mode: writeback libvirt-2-format: /tmp/usb (raw) Attached to: /machine/peripheral/usb-disk1/usb-disk1.0/legacy[0] Removable device: not locked, tray closed Cache mode: writeback libvirt-1-format: /var/lib/libvirt/images/boot.iso (raw, read-only) Attached to: scsi0-0-0-2 Removable device: not locked, tray closed Cache mode: writeback ➜ ~ virsh save rhel-9.2 /tmp/rhel Domain 'rhel-9.2' saved to /tmp/rhel ➜ ~ rpm -q libvirt libvirt-8.9.0-2.el9.x86_64 ➜ ~ virsh restore /tmp/rhel Domain restored from /tmp/rhel ➜ ~ virsh qemu-monitor-command rhel-9.2 --hmp info block libvirt-3-format: /var/lib/libvirt/images/rhel-9.2.qcow2 (qcow2) Attached to: /machine/peripheral/virtio-disk0/virtio-backend Cache mode: writeback libvirt-2-format: /tmp/usb (raw) Attached to: /machine/peripheral/usb-disk1/usb-disk1.0/legacy[0] Removable device: not locked, tray closed Cache mode: writeback libvirt-1-format: /var/lib/libvirt/images/boot.iso (raw, read-only) Attached to: scsi0-0-0-2 Removable device: not locked, tray closed Cache mode: writeback ➜ ~ cat empty.xml <disk type="file" device="cdrom"> <driver name="qemu" type="raw"/> <backingStore/> <target dev="sdc" bus="scsi"/> <readonly/> <alias name="scsi0-0-0-2"/> <address type="drive" controller="0" bus="0" target="0" unit="2"/> </disk> ➜ ~ virsh update-device rhel-9.2 empty.xml Device updated successfully 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 (libvirt bug fix and enhancement update), 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-2023:2171 |