cgroup macros refactoring, part 5
Complete the refactoring by adding missing stubs so it compiles on platform without cgroup support. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
2d795df3f0
commit
81b1915773
@ -3147,6 +3147,31 @@ virCgroupNewDetectMachine(const char *name ATTRIBUTE_UNUSED,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupNewMachine(const char *name ATTRIBUTE_UNUSED,
|
||||||
|
const char *drivername ATTRIBUTE_UNUSED,
|
||||||
|
bool privileged ATTRIBUTE_UNUSED,
|
||||||
|
const unsigned char *uuid ATTRIBUTE_UNUSED,
|
||||||
|
const char *rootdir ATTRIBUTE_UNUSED,
|
||||||
|
pid_t pidleader ATTRIBUTE_UNUSED,
|
||||||
|
bool isContainer ATTRIBUTE_UNUSED,
|
||||||
|
const char *partition ATTRIBUTE_UNUSED,
|
||||||
|
int controllers ATTRIBUTE_UNUSED,
|
||||||
|
virCgroupPtr *group ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENXIO, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
virCgroupNewIgnoreError(void)
|
||||||
|
{
|
||||||
|
VIR_DEBUG("No cgroups present/configured/accessible, ignoring error");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virCgroupFree(virCgroupPtr *group ATTRIBUTE_UNUSED)
|
virCgroupFree(virCgroupPtr *group ATTRIBUTE_UNUSED)
|
||||||
@ -3176,6 +3201,57 @@ virCgroupPathOfController(virCgroupPtr group ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupAddTask(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
pid_t pid ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENXIO, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupAddTaskController(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
pid_t pid ATTRIBUTE_UNUSED,
|
||||||
|
int controller ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENXIO, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupMoveTask(virCgroupPtr src_group ATTRIBUTE_UNUSED,
|
||||||
|
virCgroupPtr dest_group ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENXIO, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetBlkioWeight(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned int weight ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENXIO, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetBlkioWeight(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned int *weight ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENXIO, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virCgroupSetBlkioDeviceWeight(virCgroupPtr group ATTRIBUTE_UNUSED,
|
virCgroupSetBlkioDeviceWeight(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
const char *path ATTRIBUTE_UNUSED,
|
const char *path ATTRIBUTE_UNUSED,
|
||||||
@ -3187,6 +3263,170 @@ virCgroupSetBlkioDeviceWeight(virCgroupPtr group ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetMemory(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetMemoryUsage(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long *kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetMemoryHardLimit(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetMemoryHardLimit(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long *kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetMemorySoftLimit(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetMemorySoftLimit(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long *kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetMemSwapHardLimit(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetMemSwapHardLimit(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long *kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetMemSwapUsage(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long *kb ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetCpusetMems(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
const char *mems ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetCpusetMems(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
char **mems ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetCpusetCpus(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
const char *cpus ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetCpusetCpus(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
char **cpus ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupDenyAllDevices(virCgroupPtr group ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupAllowDevice(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
char type ATTRIBUTE_UNUSED,
|
||||||
|
int major ATTRIBUTE_UNUSED,
|
||||||
|
int minor ATTRIBUTE_UNUSED,
|
||||||
|
int perms ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupAllowDeviceMajor(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
char type ATTRIBUTE_UNUSED,
|
||||||
|
int major ATTRIBUTE_UNUSED,
|
||||||
|
int perms ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virCgroupAllowDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
|
virCgroupAllowDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
const char *path ATTRIBUTE_UNUSED,
|
const char *path ATTRIBUTE_UNUSED,
|
||||||
@ -3198,6 +3438,31 @@ virCgroupAllowDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupDenyDevice(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
char type ATTRIBUTE_UNUSED,
|
||||||
|
int major ATTRIBUTE_UNUSED,
|
||||||
|
int minor ATTRIBUTE_UNUSED,
|
||||||
|
int perms ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupDenyDeviceMajor(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
char type ATTRIBUTE_UNUSED,
|
||||||
|
int major ATTRIBUTE_UNUSED,
|
||||||
|
int perms ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virCgroupDenyDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
|
virCgroupDenyDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
const char *path ATTRIBUTE_UNUSED,
|
const char *path ATTRIBUTE_UNUSED,
|
||||||
@ -3209,6 +3474,56 @@ virCgroupDenyDevicePath(virCgroupPtr group ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetCpuShares(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long shares ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetCpuShares(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long *shares ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetCpuCfsPeriod(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long cfs_period ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupGetCpuCfsPeriod(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
unsigned long long *cfs_period ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupSetCpuCfsQuota(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
|
long long cfs_quota ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virCgroupRemoveRecursively(char *grppath ATTRIBUTE_UNUSED)
|
virCgroupRemoveRecursively(char *grppath ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
@ -3218,6 +3533,15 @@ virCgroupRemoveRecursively(char *grppath ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
virCgroupRemove(virCgroupPtr group ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENXIO, "%s",
|
||||||
|
_("Control groups not supported on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED,
|
virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED,
|
||||||
int signum ATTRIBUTE_UNUSED)
|
int signum ATTRIBUTE_UNUSED)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user