]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vz: support boot order in domain xml dump
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Tue, 22 Mar 2016 13:56:38 +0000 (16:56 +0300)
committerMaxim Nestratov <mnestratov@virtuozzo.com>
Thu, 7 Apr 2016 13:21:41 +0000 (16:21 +0300)
commit032c5bf988ddd6dc3bbd07692c3def1afb36a461
treebe81dea6483f5e60196434542f225fc607dcff16
parentbc281f7d7d194ad25855c3b83a565a81c5e9aa05
vz: support boot order in domain xml dump

As usual we try to deal correctly with vz domains that were
created by other means and thus can have all range of SDK domain
parameters. If vz domain boot order can't be represented
in libvirt os boot section let's give warning and make os boot section
represent SDK to some extent.

1. Os boot section supports up to 4 boot devices. Here we just
cut SDK boot order up to this limit. Not too bad.

2. If there is a floppy in boot order let's just skip it.
Anyway we don't show it in the xml. Not too bad too.

3. SDK boot order with unsupported disks order. Say we have "hdb, hda" in
SDK. We can not present this thru os boot order. Well let's just
give warning but leave double <boot dev='hd'/> in xml. It's
kind of misleading but we warn you!

SDK boot order have an extra parameters 'inUse' and 'sequenceIndex'
which makes our task more complicated. In realitly however 'inUse'
is always on and 'sequenceIndex' is not less than 'boot position index'
which simplifies out task back again! To be on a safe side let's explicitly
check for this conditions!

We have another exercise here. We want to check for unrepresentable
condition 3 (see above). The tricky part is that in contrast to
domains defined thru this driver 3-rd party defined domains can
have device ordering different from default. Thus we need
some id to check that N-th boot disk of os boot section is same as
N-th boot disk of SDK boot. This is what prlsdkBootOrderCheck
for. It uses disks sources paths as id for disks and iface names
for network devices.

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