Bug 1664324
Summary: | Failed to attach scsi controller with option "--config --live" when index attribute isn't specified in XML | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Andrea Bolognani <abologna> | ||||||
Component: | libvirt | Assignee: | Laine Stump <laine> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 8.0 | CC: | bugproxy, chhu, dyuan, hannsj_uhl, jdenemar, jkachuck, jsuchane, laine, lmen, rbalakri, xuzhang, yalzhang | ||||||
Target Milestone: | rc | Keywords: | Patch | ||||||
Target Release: | 8.3 | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | libvirt-6.0.0-17.el8 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | 1344899 | Environment: | |||||||
Last Closed: | 2020-11-04 02:53:02 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: | |||||||||
Bug Depends On: | 1559867 | ||||||||
Bug Blocks: | 1344899, 1699081, 1776265, 1846368 | ||||||||
Attachments: |
|
Description
Andrea Bolognani
2019-01-08 13:06:22 UTC
*** Bug 1647304 has been marked as a duplicate of this bug. *** ------- Comment From leonardo 2019-01-16 08:27 EDT------- Hello, This bug seems to be fixed since v4.7.0, I am trying to find the exact commit that fixed this. By fixed, I mean it does not return errors anymore and controllers are added both in --live and in --config. After a few tests, it seems the solution's added controllers can have different indexes in --live and --config if some controller is not added in both previously. ------- Comment From leonardo 2019-01-16 15:06 EDT-------
> This bug seems to be fixed since v4.7.0, I am trying to find the exact
> commit that fixed this.
The commit is :
"qemu: Use the correct vm def on cold attach "(55ce65646348884656fd7bf3f109ebf8f7603494)
(The patch is attached).
So far, I could cherry-pick this patch over v4.5.0 on git and it seems to work fine. I haven't tested it deeply, though.
---
1: machine.xml used
(attached)
2: scsi.xml used
<controller type='scsi' model='virtio-scsi' />
3: Procedure / output
$ virsh define machine.xml
Domain leo-vm1 defined from machine.xml
$ virsh start leo-vm1
Domain leo-vm1 started
$ ~/libvirt/run ~/libvirt/tools/virsh attach-device leo-vm1 scsi.xml --persistent
$ virsh dumpxml leo-vm1 |grep scsi
$ virsh destroy leo-vm1
Domain leo-vm1 destroyed
$ virsh dumpxml leo-vm1 |grep scsi
$ virsh start leo-vm1
Domain leo-vm1 started
$ virsh attach-device leo-vm1 scsi.xml --live
$ virsh dumpxml leo-vm1 |grep scsi
<controller type='scsi' index='0' model='virtio-scsi'>
<controller type='scsi' index='1' model='virtio-scsi'>
<alias name='scsi1'/>
$ virsh attach-device leo-vm1 scsi.xml --config --live
Device attached successfully
$ virsh dumpxml leo-vm1 |grep scsi
<controller type='scsi' index='0' model='virtio-scsi'>
<alias name='scsi0'/>
<controller type='scsi' index='1' model='virtio-scsi'>
<alias name='scsi1'/>
<controller type='scsi' index='2' model='virtio-scsi'>
<alias name='scsi2'/>
/virsh destroy leo-vm1
Domain leo-vm1 destroyed
$ virsh dumpxml leo-vm1 |grep scsi
<controller type='scsi' index='0' model='virtio-scsi'>
<controller type='scsi' index='1' model='virtio-scsi'>
Created attachment 1521111 [details]
patch
Created attachment 1521113 [details]
machine.xml used
------- Comment From leonardo 2019-02-07 11:16 EDT------- Hello Laine, I compiled the patch on top of RHEL8-Snapshot5 libvirt and generated the rpms for testing: (Here are all libvirt rpm outputs, just in case) ftp://testcase.software.ibm.com/fromibm/linux/libvirt-rpms-rhel8ss5-172958.tar.gz - Please use user=anonymous, passwd=anonymous if asked - Make sure to download it soon, as the link will be available for 3 business days. Could you please test it, just to make sure the bug is gone? Thank you! Yes, that patch fixes this specific problem (although it doesn't solve it in the general case, i.e. when multiple controllers are hotplugged, with different combinations of --live and --config). ------- Comment From bssrikanth.com 2019-08-30 05:29 EDT------- This issue seems to be fixed in latest beta having kernel `4.18.0-128.el8.ppc64le` , qemu-kvm-4.1.0-0.el8.patchwork201907251253.ppc64le and libvirt-5.5.0-1.module. (In reply to IBM Bug Proxy from comment #9) > ------- Comment From bssrikanth.com 2019-08-30 05:29 EDT------- > This issue seems to be fixed in latest beta having kernel > `4.18.0-128.el8.ppc64le` , > qemu-kvm-4.1.0-0.el8.patchwork201907251253.ppc64le and > libvirt-5.5.0-1.module. Yes, the patch that fixes this specific issue has been in upstream libvirt since 5.0.0. See Comment 7 though. Verified this bug with libvirt-6.0.0-17.module+el8.3.0+6423+e4cb6418.x86_64. Version: libvirt-6.0.0-17.module+el8.3.0+6423+e4cb6418.x86_64 kernel-4.18.0-213.el8.x86_64 qemu-kvm-4.2.0-19.module+el8.3.0+6473+93e27135.x86_64 Steps: 1: Prepare a shutdown VM without scsi controller, then start VM # virsh domstate test83 shut off # virsh dumpxml test83 --inactive | grep "scsi" No output # virsh start test83 Domain test83 started # virsh console test83 Connected to domain test83 Escape character is ^] Red Hat Enterprise Linux 8.3 Beta (Ootpa) Kernel 4.18.0-211.el8.x86_64 on an x86_64 localhost login: root Password: Last login: Thu Jun 11 16:20:09 on ttyS0 [root@localhost ~]# 2: Attach scsi controller without index by "virsh attach-device --config --live" # cat con.xml <controller model="virtio-scsi" type="scsi" /> # virsh attach-device test83 con.xml --config --live Device attached successfully # virsh dumpxml test83 --inactive | grep "scsi" -A2 <controller type='scsi' index='0' model='virtio-scsi'> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </controller> # virsh dumpxml test83 | grep "scsi" -A2 <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </controller> 3: Restart VM and then attach scsi controller without index by "virsh attach-device --persistent" # virsh destroy test83 ; virsh start test83 Domain test83 destroyed Domain test83 started # virsh console test83 Connected to domain test83 Escape character is ^] Red Hat Enterprise Linux 8.3 Beta (Ootpa) Kernel 4.18.0-211.el8.x86_64 on an x86_64 localhost login: root Password: Last login: Thu Jun 11 17:17:06 on ttyS0 [root@localhost ~]# # virsh dumpxml test83 --inactive | grep "scsi" -A2 <controller type='scsi' index='0' model='virtio-scsi'> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </controller> <controller type='scsi' index='1' model='virtio-scsi'> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> </controller> # virsh dumpxml test83 | grep "scsi" -A2 <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </controller> <controller type='scsi' index='1' model='virtio-scsi'> <alias name='scsi1'/> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> </controller> All test results are asexpected, move this bug to be verified. 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 (Moderate: virt:rhel and virt-devel:rhel security, 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/RHSA-2020:4676 |