Bug 1585108
| Summary: | Update virtual interface with alias return success but no change | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | yafu <yafu> |
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
| Status: | CLOSED DUPLICATE | QA Contact: | yalzhang <yalzhang> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.6 | CC: | dyuan, jiyan, lmen, mprivozn, xuzhang, yalzhang |
| Target Milestone: | rc | Keywords: | Upstream |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-4.5.0-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-01-10 16:14:36 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: | |||
Patches proposed upstream: https://www.redhat.com/archives/libvir-list/2018-June/msg00971.html Patches pushed upstream:
commit 4ad54a417a1bbe10aeffcce783f4381d8d43f799
Author: Michal Privoznik <mprivozn>
AuthorDate: Tue Jun 12 16:05:10 2018 +0200
Commit: Michal Privoznik <mprivozn>
CommitDate: Wed Jun 27 16:43:09 2018 +0200
conf: Forbid device alias change on device-update
https://bugzilla.redhat.com/show_bug.cgi?id=1585108
When updating a live device users might pass different alias than
the one the device has. Currently, this is silently ignored which
goes against our behaviour for other parts of the device where we
explicitly allow only certain changes and error out loudly on
anything else.
Signed-off-by: Michal Privoznik <mprivozn>
Reviewed-by: John Ferlan <jferlan>
commit 5e9b150fe0491f394c3235f0fdb476262b66e310
Author: Michal Privoznik <mprivozn>
AuthorDate: Tue Jun 26 10:37:27 2018 +0200
Commit: Michal Privoznik <mprivozn>
CommitDate: Wed Jun 27 16:42:27 2018 +0200
conf: Reintroduce action to virDomainDefCompatibleDevice
This was lost in c57f3fd2f8999d17e01. But now we are going to
need it again (except the DETACH action where checking for device
compatibility does not make much sense anyway).
Signed-off-by: Michal Privoznik <mprivozn>
Reviewed-by: John Ferlan <jferlan>
commit 84de7fbfdb2f528e05d98c09e3260fe0fc0739f9
Author: Michal Privoznik <mprivozn>
AuthorDate: Tue Jun 12 16:04:30 2018 +0200
Commit: Michal Privoznik <mprivozn>
CommitDate: Wed Jun 27 15:57:49 2018 +0200
qemuDomainUpdateDeviceFlags: Parse device as live if needed
When updating device it's worth parsing live info too as users
might want to update it as well.
Signed-off-by: Michal Privoznik <mprivozn>
Reviewed-by: John Ferlan <jferlan>
v4.5.0-rc1-3-g4ad54a417a
test on libvirt-4.5.0-1.el7.x86_64, the result is as expected, set this bug to be verified.
no matter match by mac, or pci address, or both, it always report error when update-device to live update alias name for interface.
1. prepare a guest with interfaces as below
# virsh dumpxml rhelq | grep /interface -B8
<interface type='network'>
<mac address='52:54:00:4d:f0:70'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<filterref filter='clean-traffic'/>
<alias name='ua-88c2decd-4883-4023-84de-a2205c777af7'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:f2:c4:0b'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet1'/>
<model type='rtl8139'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x02' function='0x0'/>
</interface>
# cat net.xml
<interface type='network'>
<mac address='52:54:00:4d:f0:70'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<filterref filter='clean-traffic'/>
<alias name='ua-88c2decd-4883-4023-84de-a2205c777af7'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</interface>
2. edit the alias name, and delete the pci address in net.xml, then do update-device. It will match by mac address.
# cat net.xml
<interface type='network'>
<mac address='52:54:00:4d:f0:70'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<filterref filter='clean-traffic'/>
<alias name='ua-88c2decd-4883-4023-84de-a2205c777af8'/>
</interface>
# virsh update-device rhelq net.xml
error: Failed to update device from net.xml
error: operation forbidden: changing device alias is not allowed
3. delete the alias name from step 2
# virsh update-device rhelq net.xml
error: Failed to update device from net.xml
error: operation forbidden: changing device alias is not allowed
===> This is expected, when there is no alias specified in xml, libvirt may generate a new one
4. add pci address, and delete mac address in step2 xml, it will match by pci address
# cat net.xml
<interface type='network'>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<filterref filter='clean-traffic'/>
<alias name='ua-88c2decd-4883-4023-84de-a2205c777af8'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</interface>
# virsh update-device rhelq net.xml
error: Failed to update device from net.xml
error: operation forbidden: changing device alias is not allowed
Hi, Michal. It seems that the patches fixing this bug have some unexpected effect on the following issue, the error is abnormal, could you please help to check it. Thank you, :) Version: kernel-3.10.0-919.el7.x86_64 libvirt-4.5.0-2.el7.x86_64 qemu-kvm-rhev-2.12.0-7.el7.x86_64 Steps: 1. Prepare a VM with the following configuration and then start VM # virsh dumpxml bug1 --inactive |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/new.iso'/> <target dev='hdb' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> # virsh start bug1 Domain bug1 started 2. Update media of active dumpxml by running the following cmd # virsh change-media bug1 hdb --update /var/lib/libvirt/images/old.iso --live Successfully updated media. # virsh dumpxml bug1 |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/old.iso'/> <backingStore/> <target dev='hdb' bus='ide'/> <readonly/> <alias name='ide0-0-1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> 3. Update media of inactive dumpxml by running the following cmd # virsh change-media bug1 hdb --update /var/lib/libvirt/images/old.iso --config Successfully updated media. # virsh dumpxml bug1 --inactive |grep "<disk" -A10 <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/old.iso'/> <target dev='hdb' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> 4. Use '--live' and '--config' at the same time, the following error raised # virsh change-media bug1 hdb --update /var/lib/libvirt/images/old.iso --config --live error: Failed to complete action update on media error: operation forbidden: changing device alias is not allowed Same for update-device:
# virsh start rhelq
Domain rhelq started
# virsh dumpxml rhelq | grep /interface -B9
<interface type='network'>
<mac address='52:54:00:ad:ad:da'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<link state='down'/>
<alias name='net1'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x02' function='0x0'/>
</interface>
# cat net.xml
<interface type='network'>
<mac address='52:54:00:ad:ad:da'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<alias name='net1'/>
<link state='up'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x02' function='0x0'/>
</interface>
# virsh update-device rhelq net.xml --config --live
error: Failed to update device from net.xml
error: operation forbidden: changing device alias is not allowed
# virsh update-device rhelq net.xml --persistent
error: Failed to update device from net.xml
error: operation forbidden: changing device alias is not allowed
Set back to ON_QA status
Filed another bug in RHEL 8 Bug 1603133 - "changing device alias is not allowed" info raised when 'change-media --config --live' for disk without changing alias I think this turned out to be duplicate of bug 1621910 and/or this bug was fixed by patches posted for that bug. Therefore I'm closing this one as a duplicate of the other. *** This bug has been marked as a duplicate of bug 1621910 *** |
Description of problem: Update virtual interface with alias return success but no change. Version-Release number of selected component (if applicable): libvirt-4.3.0-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Prepare default network interface xml with alias name: #cat interface.xml <interface type='network'> <mac address='54:52:00:54:9e:f4'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='ua-88c2decd-4883-4023-84de-a2205c777af7'/> </interface> 2.Attach it to a running guest: #virsh attach-device ovmf interface.xml Device attached successfully 3.Check the live xml: #virsh dumpxml ovmf <interface type='network'> <mac address='54:52:00:54:96:f4'/> <source network='default' bridge='virbr0'/> <target dev='vnet12'/> <model type='virtio'/> <alias name='ua-88c2decd-4883-4023-84de-a2205c777af7'/> <address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/> </interface> 4.Modify the alias name in interface.xml: #cat interface.xml <interface type='network'> <mac address='54:52:00:54:9e:f4'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> ***<alias name='ua-88c2decd'/>*** </interface> 5.Live update the virtual interface with alias name: #virsh update-device ovmf interface.xml Device updated successfully 6.Check the live xml and the alias name did not change after step 5: #virsh dumpxml ovmf <interface type='network'> <mac address='54:52:00:54:96:f4'/> <source network='default' bridge='virbr0'/> <target dev='vnet12'/> <model type='virtio'/> <alias name='ua-88c2decd-4883-4023-84de-a2205c777af7'/> <address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/> </interface> Actual results: Update virtual interface with alias return success but no change. Expected results: It should report error if not support live update of alias name. Additional info: It can report error if the virtual interface xml contains address tag, such as: #cat interface.xml <interface type='network'> <mac address='54:52:00:54:96:f4'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='ua-88c2decd-4883-4023-84de-a2205c777af7'/> ****<address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>**** </interface>