Bug 1510323
Summary: | libvirtd crash when update cdrom device two times | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | yafu <yafu> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | jiyan <jiyan> |
Severity: | unspecified | Docs Contact: | |
Priority: | high | ||
Version: | 7.5 | CC: | dyuan, jiyan, junli, lmen, mtessun, pkrempa, rbalakri, xuzhang, yisun |
Target Milestone: | rc | Keywords: | Regression |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-3.9.0-2.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 10:59:09 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: |
Description
yafu
2017-11-07 08:33:49 UTC
there is another scenario,maybe the same issue: 1.prepare a guest the cdrom xml: <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='sdc' bus='scsi'/> --->no source file <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='2'/> </disk> 2.update the cdrom with the following xml: [root@localhost ~]# cat cdrom.xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/RHEL-7.4-20170711.0-Server-x86_64-dvd1.iso'/> <target dev='sdc' bus='scsi'/> <readonly/> </disk> [root@localhost ~]# virsh update-device test cdrom.xml error: Disconnected from qemu:///system due to end of file error: Failed to update device from cdrom.xml error: End of file while reading data: Input/output error NOTE:using floppy to test the above steps is the same result failed another case, record it here for future reference. 1. have a running vm with cdrom pointing to /opt/b.iso ## virsh dumpxml v <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/opt/b.iso' startupPolicy='requisite'/> <target dev='hdb' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> 2. save the vm ## virsh save v v.save Domain v saved to v.save 3. remove or move the iso file ## mv /opt/b.iso /opt/b.iso.bkup 4. restore the vm ## virsh restore v.save error: Disconnected from qemu:///system due to end of file error: Failed to restore domain from v.save error: End of file while reading data: Input/output error Reproduce the bug in libvirt-3.9.0-1.el7.x86_64 via the following method and check the storage source private data is NULL at last 1. Prepare 2 xml files as following: # cat boot.xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # cat boot1.xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot1.iso'/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 2. Prepare shutdown vm named 'pc' and start the vm # virsh dumpxml pc --inactive |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start pc Domain pc started # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 3. Update the cdrom via boot1.xml and check the dumpxml file info # virsh update-device pc boot1.xml Device updated successfully # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot1.iso'/> <backingStore/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 4. Update the cdrom via boot.xml and check the dumpxml file info again # virsh update-device pc boot.xml error: Disconnected from qemu:///system due to end of file error: Failed to update device from boot.xml error: End of file while reading data: Input/output error # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <target dev='hda' bus='ide' tray='open'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> Test env components: libvirt-3.9.0-2.virtcov.el7.x86_64 qemu-kvm-rhev-2.10.0-6.el7.x86_64 kernel-3.10.0-774.el7.x86_64 Test scenario: Sceanrio-1: Update cdrom without src data via xml file with src data 1. Prepare xml file as following # cat cdrom.xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hda' bus='ide'/> <readonly/> <alias name='virtio-disk0'/> </disk> 2. Prepare shutdown vm named 'pc' and start vm, check the dumpxml file info # virsh dumpxml pc --inactive |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start pc Domain pc started # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 3. Update the cdrom via the xml file and check the dumpxml file info # virsh update-device pc cdrom.xml Device updated successfully # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <backingStore/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> Sceanrio-2: Update floppy without src data via xml file with src data 1. Prepare xml file as following # cat floppy.xml <disk type='file' device='floppy'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='fda' bus='fdc'/> <readonly/> <alias name='fdc0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 2. Prepare shutdown vm named 'pc' and start vm, check the dumpxml file info # virsh dumpxml pc --inactive |grep "<disk" -A10 <disk type='file' device='floppy'> <driver name='qemu' type='raw'/> <target dev='fda' bus='fdc'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start pc Domain pc started # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='floppy'> <target dev='fda' bus='fdc'/> <readonly/> <alias name='fdc0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 3. Update the cdrom via the xml file and check the dumpxml file info # virsh update-device pc floppy.xml Device updated successfully # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='floppy'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <backingStore/> <target dev='fda' bus='fdc'/> <readonly/> <alias name='fdc0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> Sceanrio-3: Update cdrom/floppy twice 1. Prepare 2 xml files as following: # cat boot.xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # cat boot1.xml <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot1.iso'/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 2. Prepare shutdown vm named 'pc' and start the vm # virsh dumpxml pc --inactive |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start pc Domain pc started # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 3. Update the cdrom via boot1.xml and check the dumpxml file info # virsh update-device pc boot1.xml Device updated successfully # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot1.iso'/> <backingStore/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 4. Update the cdrom via boot.xml and check the dumpxml file info again # virsh update-device pc boot.xml Device updated successfully # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <backingStore/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> Sceanrio-4: Restore vm with src data deleted 1. Prepare shutdown vm named 'pc', start vm and check the dumpxml file info # virsh dumpxml pc --inactive |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso' startupPolicy='requisite'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start pc Domain pc started # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso' startupPolicy='requisite'/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> 2. Save vm # virsh save pc pc.save Domain pc saved to pc.save 3. Remove src data for cdrom and then restore vm # mv /var/lib/libvirt/images/boot.iso /tmp/ # virsh restore pc.save Domain restored from pc.save 4. Check dumpxml file info of vm # virsh list --all 21 pc running # virsh dumpxml pc |grep "<disk" -A10 <disk type='file' device='cdrom'> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh dumpxml pc --inactive|grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso' startupPolicy='requisite'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> All the results are as expected, move this bug to be verified. Hi, Peter, please help to check the following 2 issues whether they are regression, thanks very much. Version: libvirt-3.9.0-5.el7.x86_64 kernel-3.10.0-820.el7.x86_64 qemu-kvm-rhev-2.10.0-12.el7.x86_64 Scenario1: insert source file for cdrom device by 'virsh change-media' # virsh domstate test shut off # virsh dumpxml test --inactive|grep "<disk" -A5 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='hdc' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> # virsh start test Domain test started # virsh domstate test running # virsh change-media test hdc --insert --current boot1.iso error: Disconnected from qemu:///system due to end of file error: Failed to complete action insert on media error: End of file while reading data: Input/output error Scenario2: update source file for cdrom device by 'virsh change-media' # virsh domstate test shut off # virsh dumpxml test --inactive|grep "<disk" -A6 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> # virsh start test Domain test started # virsh change-media test hdc --update --current boot1.iso error: Disconnected from qemu:///system due to end of file error: Failed to complete action update on media error: End of file while reading data: Input/output error This looks like an instance of https://bugzilla.redhat.com/show_bug.cgi?id=1522682 could you please re-try with the -6 package? The error message reported with upstream git version is: error: Cannot access storage file 'boot1.iso': No such file or directory which was modified not to contain the uid and gid in some cases due to the above bug. Hi, Peter, sry for checking this issue so late, the following is detailed info. Error info is same as you said in libvirt-3.9.0-6.el7.x86_64. Version: kernel-3.10.0-826.el7.x86_64 libvirt-3.9.0-6.el7.x86_64 qemu-kvm-rhev-2.10.0-15.el7.x86_64 Scenario1: insert source file for cdrom device by 'virsh change-media' # ll boot.iso boot1.iso -rw-r--r--. 1 root root 536870912 Jan 8 10:31 boot1.iso -rw-r--r--. 1 qemu qemu 536870912 Dec 15 16:17 boot.iso # virsh domstate test shut off # virsh dumpxml test |grep "<disk" -A5 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start test Domain test started # virsh domstate test running # virsh change-media test hda --insert --current boot.iso error: Failed to complete action insert on media error: Cannot access storage file 'boot.iso': No such file or directory Scenario2: update source file for cdrom device by 'virsh change-media' # ll boot.iso boot1.iso -rw-r--r--. 1 root root 536870912 Jan 8 10:31 boot1.iso -rw-r--r--. 1 qemu qemu 536870912 Dec 15 16:17 boot.iso # virsh domstate test shut off # virsh dumpxml test |grep "<disk" -A6 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/boot.iso'/> <target dev='hda' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start test Domain test started # virsh change-media test hda --update --current boot1.iso error: Failed to complete action update on media error: Cannot access storage file 'boot1.iso': No such file or directory Yes, so the last findings were the problem I've described so this should be okay now. 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/RHEA-2018:0704 |