Bug 1439991
Summary: | Suggest to disable update "boot order" in interface by update-device | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | yalzhang <yalzhang> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
Status: | CLOSED ERRATA | QA Contact: | yalzhang <yalzhang> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.4 | CC: | fjin, jsuchane, mprivozn, rbalakri, xuzhang |
Target Milestone: | rc | Keywords: | Upstream |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-3.9.0-1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 10:42:33 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
yalzhang@redhat.com
2017-04-07 03:24:33 UTC
Patch proposed upstream: https://www.redhat.com/archives/libvir-list/2017-September/msg00092.html I've just pushed the patch upstream: commit c57f3fd2f8999d17e01272246b26d31179ab7b6e Author: Michal Privoznik <mprivozn> AuthorDate: Tue Sep 5 16:24:14 2017 +0200 Commit: Michal Privoznik <mprivozn> CommitDate: Wed Sep 6 11:19:30 2017 +0200 conf: Validate device on update-device https://bugzilla.redhat.com/show_bug.cgi?id=1439991 Whenever a device is being updated via virDomainUpdateDeviceFlags() API, we parse the device XML and ideally run some generic checks to validate the configuration (e.g. if device defines per-device boot order but the domain has os/boot element already). Well, that's the theory - due to a missing check we've jumped early from that check function. Signed-off-by: Michal Privoznik <mprivozn> Reviewed-by: Erik Skultety <eskultet> v3.7.0-14-gc57f3fd2f verify this bug on libvirt-3.8.0-1.el7.x86_64, it will do the check for os/boot, and any duplicate 'boot order', but it do not validate the value of the 'boot order'. Using negative number or string will cause libvirtd crash(see step 6). 1. attach interface with boot order to the guest with os/boot: # cat net.xml <interface type='network'> <source network='default' bridge='virbr0'/> <mac address='00:16:3e:77:e2:ed'/> <boot order='1'/> <model type='virtio'/> </interface> # virsh dumpxml rhel ... <os> <type arch='x86_64' machine='pc-i440fx-rhel7.4.0'>hvm</type> <boot dev='hd'/> </os> ... # virsh attach-device rhel7.4 net.xml error: Failed to attach device from net.xml error: unsupported configuration: per-device boot elements cannot be used together with os/boot elements 2. attach interface with <boot order='1'/> to the guest with <boot order='1'/> in <disk/>: # virsh attach-device rhel7.4 net.xml error: Failed to attach device from net.xml error: unsupported configuration: boot order 1 is already used by another device 3. attach interface with <boot order='2'/> to the guest with <boot order='1'/> in <disk/>: # cat net1.xml <interface type='network'> <source network='default' bridge='virbr0'/> <mac address='00:16:3e:77:e2:ed'/> <boot order='2'/> <model type='virtio'/> </interface> # virsh attach-device rhel7.4 net1.xml Device attached successfully 4. cold plug with guest have os/boot # virsh attach-device rhel7.4 net.xml --persistent error: Failed to attach device from net.xml error: unsupported configuration: per-device boot elements cannot be used together with os/boot elements 5. cold plug with <boot order='1'/> while <boot order='1'/> already defined # virsh attach-device rhel7.4 net.xml --persistent error: Failed to attach device from net.xml error: unsupported configuration: boot order 1 is already used by another device 6. use negative number or string: # cat net2.xml <interface type='network'> <source network='default' bridge='virbr0'/> <mac address='00:16:3e:77:e2:ed'/> <boot order='-1'/> <model type='virtio'/> </interface> # pidof libvirtd 23939 # virsh attach-device rhel7.4 net2.xml error: Disconnected from qemu:///system due to end of file error: Failed to attach device from net2.xml error: End of file while reading data: Input/output error # pidof libvirtd 24255 # cat net3.xml <interface type='network'> <source network='default' bridge='virbr0'/> <mac address='00:16:3e:77:e2:ed'/> <boot order='s'/> <model type='virtio'/> </interface> # virsh attach-device rhel7.4 net3.xml error: Disconnected from qemu:///system due to end of file error: Failed to attach device from net3.xml error: End of file while reading data: Input/output error # pidof libvirtd 24480 Yes, that is a crasher. However, it's fixed upstream: commit 921d61575d6ca7f6242195e7e316904b766da668 Author: Nikolay Shirokovskiy <nshirokovskiy> AuthorDate: Tue Oct 17 16:56:33 2017 +0300 Commit: John Ferlan <jferlan> CommitDate: Tue Oct 17 15:49:25 2017 -0400 conf: fix use of uninitialized variable If same boot order is specified twice (or more) in domain xml we call free for uninitiaziled loadparm on cleanup in virDomainDeviceBootParseXML and SIGABRT (or similar) as a result. v3.8.0-138-g921d61575 Moving back to post to pick up this commit. Test on upstream with the patch, it works well and the crash issue is fixed. Test on libvirt-3.9.0-1.el7.x86_64 with scenarios in comment 5, it works ok. 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 |