Bug 1599513
Summary: | unsupported live update of interface's rom 'enabled' attribute reports success | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | yalzhang <yalzhang> | |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | yalzhang <yalzhang> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 8.0 | CC: | chhu, fjin, jdenemar, jsuchane, kkoukiou, lmen, xuzhang | |
Target Milestone: | rc | Keywords: | TestOnly | |
Target Release: | 8.0 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-5.0.0-1.el8 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1661367 (view as bug list) | Environment: | ||
Last Closed: | 2020-03-11 22:33:06 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: | ||||
Bug Blocks: | 1661367 |
Description
yalzhang@redhat.com
2018-07-10 01:33:24 UTC
v4.5.0-148-g611b038fb6 commit 611b038fb60e23eb574148192090f33bc7264be2 Author: Katerina Koukiou <kkoukiou> Date: Fri Jul 13 15:07:58 2018 +0200 qemu: hotplug: report error when changing rom enabled attr for net iface Test on libvirt-4.5.0-4.el7.x86_64, when update device with new xml without pci address, the issue still exists, check scenario 2, it is just like Bug 1585108. I have tried several scenarios and found when update-device for interface, the new xml must include the correct mac address for the interface, and the pci address is not a must. If do not specify the pci address, the behavior is different, like Bug 1585108 and scenario 2 here. Scenario 1: 1) Prepare vm running with below interface: # virsh dumpxml rhel | grep /interface -B7 <interface type='network'> <mac address='52:54:00:fa:81:87'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='rtl8139'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> 2) Add "<rom enabled='yes'/>" and update the device: # virsh dumpxml rhel | grep /interface -B7 > net.xml # cat net.xml <interface type='network'> <mac address='52:54:00:fa:81:87'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='rtl8139'/> ** <rom enabled='yes'/> ** <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> # virsh update-device rhel net.xml error: Failed to update device from net.xml error: Operation not supported: cannot modify network device rom enabled setting This is expected, but when delete the pci address in the xml, it still report succeed but no changes: Scenario 2: # cat net.xml <interface type='network'> <mac address='52:54:00:fa:81:87'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='rtl8139'/> <alias name='net0'/> ** <rom enabled='yes'/> ** </interface> # virsh update-device rhel net.xml Device updated successfully # virsh dumpxml rhel | grep /interface -B7 <interface type='network'> <mac address='52:54:00:fa:81:87'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='rtl8139'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> Except the 'enabled' attribute, there is same issue with other attributes of rom element: bar, file. when update with new xml without pci address, the behavior is unexpected. 1. The vm is running with interface as below, no rom setting: # virsh dumpxml rhel |grep /interface -B8 <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <boot order='1'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> # virsh dumpxml rhel |grep /interface -B8 > net.xml 2. Edit the xml to add "<rom bar='off'/>", keep the pci address in the new xml # cat net.xml <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <boot order='1'/> ** <rom bar='off'/> ** <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> # virsh update-device rhel net.xml error: Failed to update device from net.xml error: Operation not supported: cannot modify network device rom bar setting This is expected, but when delete the pci address in the new xml: 3. Delete the pci address in the new xml, the update will report success, but no changes in xml: # cat net.xml <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <boot order='1'/> **<rom bar='off'/> ** <alias name='net0'/> </interface> # virsh update-device rhel net.xml Device updated successfully # virsh dumpxml rhel | grep /interface -B8 <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <boot order='1'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> same with file attribute # cat net.xml <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <boot order='1'/> ** <rom file='/usr/share/qemu-kvm/pxe-virtio.rom'/> ** <alias name='net0'/> </interface> # virsh update-device rhel net.xml Device updated successfully # virsh dumpxml rhel | grep /interface -B9 | grep rom ===> no outputs Same with boot order, which do not support live update either: 1. prepare running vm with "<boot order='1'/>" in interface # virsh dumpxml rhel | grep /interface -B8 <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> ** <boot order='1'/> ** <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> 2. change the boot order into 2 in new xml, and delete the pci address # cat net.xml <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> ** <boot order='2'/> ** <alias name='net0'/> </interface> 3. live update report success, but no change in xml # virsh update-device rhel net.xml Device updated successfully # virsh dumpxml rhel | grep /interface -B8 <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> ** <boot order='1'/> ** <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> 4. if add the pci address, it will report error, this is expected # cat net.xml <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> ** <boot order='2'/> ** <alias name='net0'/> *<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>* </interface> # virsh update-device rhel net.xml error: Failed to update device from net.xml error: Operation not supported: cannot modify network device boot index setting v4.6.0-319-gaa3e07caec commit aa3e07caec6179dfa6479deab14a21a493637d53 Author: Katerina Koukiou <kkoukiou> Date: Fri Aug 24 12:28:41 2018 +0200 qemu: qemuDomainChangeNet: validity checks should be done before XML autocompletion I have tested on the version which the patch in comment 10 should be included. And for scenarios as below, when update something to null, the same issue occurs. It is tracked in bug 1661367 1. <rom enabled='yes'/> to <rom enabled='no'/> with/without pci ------> PASS(not support) 2. <rom enabled='yes'/> to NULL with/without pci ---------> FAIL(report succeed but no changes) 3. NULL to <rom enabled='no'> with/without pci --------> PASS(not support) 4. <boot order='1'/> to <boot order='2'/> with/without pci -----> PASS 5. <boot order='1'/> to NULL without/with pci ------> FAIL 6. NULL to <boot order='1'/> with/without pci --------> PASS https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUpdateDeviceFlags Per our documentation for virDomainUpdateDeviceFlags: This method is used for actions such changing CDROM/Floppy device media, altering the graphics configuration such as password, reconfiguring the NIC device backend connectivity, etc. This API is not intended to allow changing the frontend on the interface. In that spirit, we have allowed changing the interface based on incomplete XML - in practice, one of (MAC address, PCI address) is enough to match the network. This is ambiguous and can lead to people specifying incomplete XML, so Michal added more documentation for bug 1621910: The supplied XML description of the device should contain all the information that is found in the corresponding domain XML. Leaving out any piece of information may be treated as a request for its removal, which may be denied. Per comment 12, we already correctly report an error when the <rom> or <boot order> attributes are present and different, which is not a supported change. For omitted attributes, let's deal with that in bug 1661367 Test on libvirt-5.0.0-11.module+el8.0.1+3459+e357ef2f.x86_64 with scenarios in comment 12, the result is the same as in comment 12. Per comment 13, move this bug to be verified. This was verified and shipped long ago. Closing the bug report. |