vz: Do not use magic constants when building capabilities

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2017-03-14 14:28:45 +01:00
parent 4c818e76aa
commit ffb3f69448

View File

@ -119,9 +119,12 @@ vzBuildCapabilities(void)
if (nodeCapsInitNUMA(caps) < 0) if (nodeCapsInitNUMA(caps) < 0)
goto error; goto error;
for (i = 0; i < 2; i++)
for (j = 0; j < 2; j++) verify(ARRAY_CARDINALITY(archs) == ARRAY_CARDINALITY(emulators));
for (k = 0; k < 2; k++)
for (i = 0; i < ARRAY_CARDINALITY(os_types); i++)
for (j = 0; j < ARRAY_CARDINALITY(archs); j++)
for (k = 0; k < ARRAY_CARDINALITY(emulators); k++)
if (vzCapsAddGuestDomain(caps, ostypes[i], archs[j], if (vzCapsAddGuestDomain(caps, ostypes[i], archs[j],
emulators[k], virt_types[k]) < 0) emulators[k], virt_types[k]) < 0)
goto error; goto error;