]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vz: support boot order specification on define domain
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Tue, 22 Mar 2016 13:56:36 +0000 (16:56 +0300)
committerMaxim Nestratov <mnestratov@virtuozzo.com>
Thu, 7 Apr 2016 13:21:40 +0000 (16:21 +0300)
commit497dcafc2e031a5b07f983adcb3ea6517318a44d
treea2b75b56119ab991365bdc72f6cfc33569d9fd4c
parent03e8d5fb54c7c897225ed9ea56d83b894930f144
vz: support boot order specification on define domain

The patch makes some refactoring of the existing code. Current boot order spec code
makes very simple thing in somewhat obscure way. In case of VMs
it sets the first hdd as the only bootable device. In case of CTs it
doesn't touch the boot order at all if one of the filesystems is mounted to root.
Otherwise like in case of VMs it sets the first hdd as the only bootable
device and additionally sets this device mount point to root. Refactored
code makes all this explicit.

The actual boot order support is simple. Common libvirt domain xml parsing
code makes the exact ordering of disks devices as described in docs
for boot ordering (disks are sorted by bus order first, device target
second. Bus order is the order of disk buses appearence in original
xml. Device targets order is alphabetical). We add devices in the
same order and SDK designates device indexes sequentially for each
device type. Thus device index is equal to its boot index. For
example N-th cdrom in boot specification refers to sdk cdrom with
it's device index N.

If there is no boot spec in xml the parsing code will add <boot dev='hdd'>
for HVMs automatically and we backward compatibly set fist hdd as
bootable.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
src/vz/vz_sdk.c