Bug 1007754
Summary: | libvirt should forbid to attach a device with boot order for the first time if the os/boot element exists | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | hongming <honzhang> | |
Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> | |
Status: | CLOSED WONTFIX | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | medium | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 6.5 | CC: | acathrow, dyuan, jiahu, mzhan, zsong | |
Target Milestone: | rc | Keywords: | Upstream | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1007759 (view as bug list) | Environment: | ||
Last Closed: | 2014-04-04 20:56:56 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: | 1007759 |
Description
hongming
2013-09-13 09:19:55 UTC
This bug also can reproduce on other device, I think libvirt should parse continuity/consistency of <boot order> before adding bootable device with attach-device. 1. [root@test666 ~]# virsh list --all Id Name State ---------------------------------------------------- - r6 shut off [root@test666 ~]# virsh dumpxml r6 | grep boot <on_reboot>restart</on_reboot> <boot order='1'/> [root@test666 ~]# cat disk1.xml <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/var/lib/libvirt/images/test.img'/> <target dev='hdb' bus='ide'/> <boot order='5'/> </disk> [root@test666 ~]# virsh attach-device r6 disk1.xml --config <=====libvirt did not check continuity of boot order for first time. Device attached successfully [root@test666 ~]# virsh dumpxml r6 | grep boot <on_reboot>restart</on_reboot> <boot order='1'/> <boot order='5'/> [root@test666 ~]# virsh start r6 error: Failed to start domain r6 error: internal error boot orders have to be contiguous and starting from 1 [root@test666 ~]# virsh attach-device r6 disk1.xml --config error: Failed to attach device from disk1.xml error: internal error boot orders have to be contiguous and starting from 1 <=======libvirt report the error for the first time. 2. [root@test666 ~]# virsh dumpxml r6 | grep boot <on_reboot>restart</on_reboot> <boot order='1'/> [root@test666 ~]# cat disk1.xml <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/var/lib/libvirt/images/test.img'/> <target dev='hdb' bus='ide'/> <boot order='1'/> </disk> [root@test666 ~]# virsh attach-device r6 disk1.xml --config <=====libvirt did not check consistency of boot order for first time. Device attached successfully [root@test666 ~]# virsh dumpxml r6 | grep boot <on_reboot>restart</on_reboot> <boot order='1'/> <boot order='1'/> [root@test666 ~]# virsh attach-device r6 disk1.xml --config error: Failed to attach device from disk1.xml error: internal error boot order 1 used for more than one device <=======libvirt report the error for the first time. This is now fixed upstream by v1.2.2-292-g6dc75f5..v1.2.2-295-g585076c: commit 6dc75f565418a169d6b86e059bcce3d0082c8e3e Author: Jiri Denemark <jdenemar> Date: Thu Mar 20 13:04:06 2014 +0100 Fix usage of virDomainDefCompatibleDevice A device needs to be checked for compatibility with the domain definition it corresponds to. Specifically, for VIR_DOMAIN_AFFECT_CONFIG case we should check against persistent def rather than active def. Signed-off-by: Jiri Denemark <jdenemar> commit 1c13166134bd2dd1fc5711e421ac5f983bece6a6 Author: Jiri Denemark <jdenemar> Date: Thu Mar 20 13:39:20 2014 +0100 Pass action to virDomainDefCompatibleDevice When checking compatibility of a device with a domain definition, we should know what we're going to do with the device. Because we may need to check for different things when we're attaching a new device versus detaching an existing device. Signed-off-by: Jiri Denemark <jdenemar> commit 563a12b3463e9a665fae02589437ecd6dba89f6b Author: Jiri Denemark <jdenemar> Date: Thu Mar 20 22:34:00 2014 +0100 conf: Introduce virDomainDeviceGetInfo API The offset of virDomainDeviceInfo structure within a device definition varies with device type and some types do not contain the info structure at all. This new API makes it easier to access the info structure from a generic virDomainDeviceDef structure. Signed-off-by: Jiri Denemark <jdenemar> commit 585076c7e602bb52d34fad83963035fc03652248 Author: Jiri Denemark <jdenemar> Date: Thu Mar 20 15:34:32 2014 +0100 Check boot order on device attach https://bugzilla.redhat.com/show_bug.cgi?id=1007754 When attaching a new device, we need to check if its boot order configuration is compatible with current domain definition. Signed-off-by: Jiri Denemark <jdenemar> *** Bug 1030796 has been marked as a duplicate of this bug. *** Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. |