1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-26 14:03:49 +03:00

vz: fix disk order on load domain

We want to report boot order in dumpxml for vz domains.
Thus we want disks devices to be sorted in output compatible with boot
ordering specification. So let's just use virDomainDiskInsert
which makes appropriate sorting.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
Nikolay Shirokovskiy 2016-03-22 16:56:37 +03:00 committed by Maxim Nestratov
parent 497dcafc2e
commit bc281f7d7d

View File

@ -663,7 +663,7 @@ prlsdkAddDomainHardDisksInfo(vzConnPtr privconn, PRL_HANDLE sdkdom, virDomainDef
if (prlsdkGetDiskInfo(privconn, hdd, disk, false, IS_CT(def)) < 0)
goto error;
if (VIR_APPEND_ELEMENT(def->disks, def->ndisks, disk) < 0)
if (virDomainDiskInsert(def, disk) < 0)
goto error;
disk = NULL;
@ -706,7 +706,7 @@ prlsdkAddDomainOpticalDisksInfo(vzConnPtr privconn, PRL_HANDLE sdkdom, virDomain
PrlHandle_Free(cdrom);
cdrom = PRL_INVALID_HANDLE;
if (VIR_APPEND_ELEMENT(def->disks, def->ndisks, disk) < 0)
if (virDomainDiskInsert(def, disk) < 0)
goto error;
}