mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
virHostCPUGet(Map|Stats): Remove unused 'flags'
The utility functions which get CPU map and stats don't actually use the flags. Remove the argument and move the 'virCheckFlags' to driver implementation. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
@@ -1145,10 +1145,12 @@ bhyveNodeGetCPUStats(virConnectPtr conn,
|
||||
int *nparams,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUStatsEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetStats(cpuNum, params, nparams, flags);
|
||||
return virHostCPUGetStats(cpuNum, params, nparams);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1359,10 +1361,12 @@ bhyveNodeGetCPUMap(virConnectPtr conn,
|
||||
unsigned int *online,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUMapEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetMap(cpumap, online, flags);
|
||||
return virHostCPUGetMap(cpumap, online);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
+5
-2
@@ -1642,12 +1642,15 @@ chDomainGetVcpuPinInfo(virDomain *dom,
|
||||
static int
|
||||
chNodeGetCPUMap(virConnectPtr conn,
|
||||
unsigned char **cpumap,
|
||||
unsigned int *online, unsigned int flags)
|
||||
unsigned int *online,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUMapEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetMap(cpumap, online, flags);
|
||||
return virHostCPUGetMap(cpumap, online);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4787,10 +4787,12 @@ lxcNodeGetCPUStats(virConnectPtr conn,
|
||||
int *nparams,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUStatsEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetStats(cpuNum, params, nparams, flags);
|
||||
return virHostCPUGetStats(cpuNum, params, nparams);
|
||||
}
|
||||
|
||||
|
||||
@@ -4868,10 +4870,12 @@ lxcNodeGetCPUMap(virConnectPtr conn,
|
||||
unsigned int *online,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUMapEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetMap(cpumap, online, flags);
|
||||
return virHostCPUGetMap(cpumap, online);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1849,7 +1849,9 @@ openvzNodeGetCPUStats(virConnectPtr conn G_GNUC_UNUSED,
|
||||
int *nparams,
|
||||
unsigned int flags)
|
||||
{
|
||||
return virHostCPUGetStats(cpuNum, params, nparams, flags);
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
return virHostCPUGetStats(cpuNum, params, nparams);
|
||||
}
|
||||
|
||||
|
||||
@@ -1890,7 +1892,9 @@ openvzNodeGetCPUMap(virConnectPtr conn G_GNUC_UNUSED,
|
||||
unsigned int *online,
|
||||
unsigned int flags)
|
||||
{
|
||||
return virHostCPUGetMap(cpumap, online, flags);
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
return virHostCPUGetMap(cpumap, online);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16390,10 +16390,12 @@ qemuNodeGetCPUStats(virConnectPtr conn,
|
||||
int *nparams,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUStatsEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetStats(cpuNum, params, nparams, flags);
|
||||
return virHostCPUGetStats(cpuNum, params, nparams);
|
||||
}
|
||||
|
||||
|
||||
@@ -16471,10 +16473,12 @@ qemuNodeGetCPUMap(virConnectPtr conn,
|
||||
unsigned int *online,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUMapEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetMap(cpumap, online, flags);
|
||||
return virHostCPUGetMap(cpumap, online);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1043,11 +1043,8 @@ virHostCPUGetInfo(virArch hostarch G_GNUC_UNUSED,
|
||||
int
|
||||
virHostCPUGetStats(int cpuNum G_GNUC_UNUSED,
|
||||
virNodeCPUStatsPtr params G_GNUC_UNUSED,
|
||||
int *nparams G_GNUC_UNUSED,
|
||||
unsigned int flags)
|
||||
int *nparams G_GNUC_UNUSED)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
#ifdef __linux__
|
||||
{
|
||||
int ret;
|
||||
@@ -1144,14 +1141,11 @@ virHostCPUGetOnlineBitmap(void)
|
||||
|
||||
int
|
||||
virHostCPUGetMap(unsigned char **cpumap,
|
||||
unsigned int *online,
|
||||
unsigned int flags)
|
||||
unsigned int *online)
|
||||
{
|
||||
g_autoptr(virBitmap) cpus = NULL;
|
||||
int ncpus = virHostCPUGetCount();
|
||||
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (!cpumap && !online)
|
||||
return ncpus;
|
||||
|
||||
|
||||
@@ -36,8 +36,7 @@ struct _virHostCPUTscInfo {
|
||||
|
||||
int virHostCPUGetStats(int cpuNum,
|
||||
virNodeCPUStatsPtr params,
|
||||
int *nparams,
|
||||
unsigned int flags);
|
||||
int *nparams);
|
||||
|
||||
bool virHostCPUHasBitmap(void);
|
||||
virBitmap *virHostCPUGetPresentBitmap(void);
|
||||
@@ -49,8 +48,7 @@ int virHostCPUGetCount(void);
|
||||
int virHostCPUGetThreadsPerSubcore(virArch arch) ATTRIBUTE_MOCKABLE;
|
||||
|
||||
int virHostCPUGetMap(unsigned char **cpumap,
|
||||
unsigned int *online,
|
||||
unsigned int flags);
|
||||
unsigned int *online);
|
||||
int virHostCPUGetInfo(virArch hostarch,
|
||||
unsigned int *cpus,
|
||||
unsigned int *mhz,
|
||||
|
||||
+6
-2
@@ -1000,10 +1000,12 @@ vzNodeGetCPUMap(virConnectPtr conn,
|
||||
unsigned int *online,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUMapEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetMap(cpumap, online, flags);
|
||||
return virHostCPUGetMap(cpumap, online);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1964,10 +1966,12 @@ vzNodeGetCPUStats(virConnectPtr conn,
|
||||
int *nparams,
|
||||
unsigned int flags)
|
||||
{
|
||||
virCheckFlags(0, -1);
|
||||
|
||||
if (virNodeGetCPUStatsEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
return virHostCPUGetStats(cpuNum, params, nparams, flags);
|
||||
return virHostCPUGetStats(cpuNum, params, nparams);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -249,7 +249,7 @@ linuxTestHostCPUGetMap(const void *data G_GNUC_UNUSED)
|
||||
{
|
||||
g_autofree unsigned char *cpumap = NULL;
|
||||
|
||||
int ncpus = virHostCPUGetMap(&cpumap, NULL, 0);
|
||||
int ncpus = virHostCPUGetMap(&cpumap, NULL);
|
||||
|
||||
g_autoptr(virBitmap) actual = virBitmapNewData(cpumap, VIR_DIV_UP(ncpus, 8));
|
||||
g_autoptr(virBitmap) expected = NULL;
|
||||
|
||||
Reference in New Issue
Block a user