Init host cache info in drivers

Added only in drivers that were already calling
virCapabilitiesInitNUMA().  Instead of refactoring all the callers to
behave the same way in case of error, just follow what the callers are
doing for all the functions.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2017-03-29 15:52:31 +02:00
parent 4ad6a73bfc
commit 72e04d2800
8 changed files with 23 additions and 0 deletions

View File

@ -81,6 +81,9 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver)
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
}
if (virCapabilitiesInitCaches(caps) < 0)
VIR_WARN("Failed to get host CPU cache info");
/* Only probe for power management capabilities in the driver,
* not in the emulator */
if (driver && virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)

View File

@ -168,6 +168,9 @@ virCapsPtr openvzCapsInit(void)
if (virCapabilitiesInitNUMA(caps) < 0)
goto no_memory;
if (virCapabilitiesInitCaches(caps) < 0)
goto no_memory;
if ((guest = virCapabilitiesAddGuest(caps,
VIR_DOMAIN_OSTYPE_EXE,
caps->host.arch,

View File

@ -340,6 +340,9 @@ phypCapsInit(void)
("Failed to query host NUMA topology, disabling NUMA capabilities");
}
if (virCapabilitiesInitCaches(caps) < 0)
VIR_WARN("Failed to get host CPU cache info");
if ((guest = virCapabilitiesAddGuest(caps,
VIR_DOMAIN_OSTYPE_LINUX,
caps->host.arch,

View File

@ -1123,6 +1123,9 @@ virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache)
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
}
if (virCapabilitiesInitCaches(caps) < 0)
VIR_WARN("Failed to get host CPU cache info");
if (!(caps->host.cpu = virCPUProbeHost(caps->host.arch)))
VIR_WARN("Failed to get host CPU");

View File

@ -69,6 +69,9 @@ virCapsPtr umlCapsInit(void)
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
}
if (virCapabilitiesInitCaches(caps) < 0)
VIR_WARN("Failed to get host CPU cache info");
if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
VIR_WARN("Failed to get host power management capabilities");

View File

@ -79,6 +79,9 @@ vboxCapsInit(void)
if (virCapabilitiesInitNUMA(caps) < 0)
goto no_memory;
if (virCapabilitiesInitCaches(caps) < 0)
goto no_memory;
if ((guest = virCapabilitiesAddGuest(caps,
VIR_DOMAIN_OSTYPE_HVM,
caps->host.arch,

View File

@ -68,6 +68,9 @@ vmwareCapsInit(void)
if (virCapabilitiesInitNUMA(caps) < 0)
goto error;
if (virCapabilitiesInitCaches(caps) < 0)
goto error;
/* i686 guests are always supported */
if ((guest = virCapabilitiesAddGuest(caps,
VIR_DOMAIN_OSTYPE_HVM,

View File

@ -118,6 +118,8 @@ vzBuildCapabilities(void)
if (virCapabilitiesInitNUMA(caps) < 0)
goto error;
if (virCapabilitiesInitCaches(caps) < 0)
goto error;
verify(ARRAY_CARDINALITY(archs) == ARRAY_CARDINALITY(emulators));