提交 04c18d25 编写于 作者: D Daniel P. Berrange

Rename virCgroupForXXX to virCgroupNewXXX

Rename all the virCgroupForXXX methods to use the form
virCgroupNewXXX since they are all constructors. Also
make sure the output parameter is the last one in the
list, and annotate all pointers as non-null. Fix up
all callers, and make sure they use true/false not 0/1
for the boolean parameters
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 f0e5f924
...@@ -1101,11 +1101,6 @@ virCgroupDenyAllDevices; ...@@ -1101,11 +1101,6 @@ virCgroupDenyAllDevices;
virCgroupDenyDevice; virCgroupDenyDevice;
virCgroupDenyDeviceMajor; virCgroupDenyDeviceMajor;
virCgroupDenyDevicePath; virCgroupDenyDevicePath;
virCgroupForDomain;
virCgroupForDriver;
virCgroupForEmulator;
virCgroupForSelf;
virCgroupForVcpu;
virCgroupFree; virCgroupFree;
virCgroupGetBlkioWeight; virCgroupGetBlkioWeight;
virCgroupGetCpuacctPercpuUsage; virCgroupGetCpuacctPercpuUsage;
...@@ -1127,6 +1122,11 @@ virCgroupKill; ...@@ -1127,6 +1122,11 @@ virCgroupKill;
virCgroupKillPainfully; virCgroupKillPainfully;
virCgroupKillRecursive; virCgroupKillRecursive;
virCgroupMoveTask; virCgroupMoveTask;
virCgroupNewDomain;
virCgroupNewDriver;
virCgroupNewEmulator;
virCgroupNewSelf;
virCgroupNewVcpu;
virCgroupPathOfController; virCgroupPathOfController;
virCgroupRemove; virCgroupRemove;
virCgroupRemoveRecursively; virCgroupRemoveRecursively;
......
...@@ -293,7 +293,7 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo) ...@@ -293,7 +293,7 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo)
int ret; int ret;
virCgroupPtr cgroup; virCgroupPtr cgroup;
ret = virCgroupForSelf(&cgroup); ret = virCgroupNewSelf(&cgroup);
if (ret < 0) { if (ret < 0) {
virReportSystemError(-ret, "%s", virReportSystemError(-ret, "%s",
_("Unable to get cgroup for container")); _("Unable to get cgroup for container"));
...@@ -529,14 +529,14 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def) ...@@ -529,14 +529,14 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def)
virCgroupPtr cgroup = NULL; virCgroupPtr cgroup = NULL;
int rc; int rc;
rc = virCgroupForDriver("lxc", &driver, 1, 0, -1); rc = virCgroupNewDriver("lxc", true, false, -1, &driver);
if (rc != 0) { if (rc != 0) {
virReportSystemError(-rc, "%s", virReportSystemError(-rc, "%s",
_("Unable to get cgroup for driver")); _("Unable to get cgroup for driver"));
goto cleanup; goto cleanup;
} }
rc = virCgroupForDomain(driver, def->name, &cgroup, 1); rc = virCgroupNewDomain(driver, def->name, true, &cgroup);
if (rc != 0) { if (rc != 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to create cgroup for domain %s"), _("Unable to create cgroup for domain %s"),
......
...@@ -224,9 +224,11 @@ int qemuInitCgroup(virQEMUDriverPtr driver, ...@@ -224,9 +224,11 @@ int qemuInitCgroup(virQEMUDriverPtr driver,
virCgroupFree(&priv->cgroup); virCgroupFree(&priv->cgroup);
rc = virCgroupForDriver("qemu", &driverGroup, rc = virCgroupNewDriver("qemu",
cfg->privileged, true, cfg->privileged,
cfg->cgroupControllers); true,
cfg->cgroupControllers,
&driverGroup);
if (rc != 0) { if (rc != 0) {
if (rc == -ENXIO || if (rc == -ENXIO ||
rc == -EPERM || rc == -EPERM ||
...@@ -241,7 +243,7 @@ int qemuInitCgroup(virQEMUDriverPtr driver, ...@@ -241,7 +243,7 @@ int qemuInitCgroup(virQEMUDriverPtr driver,
goto cleanup; goto cleanup;
} }
rc = virCgroupForDomain(driverGroup, vm->def->name, &priv->cgroup, 1); rc = virCgroupNewDomain(driverGroup, vm->def->name, true, &priv->cgroup);
if (rc != 0) { if (rc != 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to create cgroup for %s"), _("Unable to create cgroup for %s"),
...@@ -643,7 +645,7 @@ int qemuSetupCgroupForVcpu(virDomainObjPtr vm) ...@@ -643,7 +645,7 @@ int qemuSetupCgroupForVcpu(virDomainObjPtr vm)
} }
for (i = 0; i < priv->nvcpupids; i++) { for (i = 0; i < priv->nvcpupids; i++) {
rc = virCgroupForVcpu(priv->cgroup, i, &cgroup_vcpu, 1); rc = virCgroupNewVcpu(priv->cgroup, i, true, &cgroup_vcpu);
if (rc < 0) { if (rc < 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to create vcpu cgroup for %s(vcpu:" _("Unable to create vcpu cgroup for %s(vcpu:"
...@@ -721,7 +723,7 @@ int qemuSetupCgroupForEmulator(virQEMUDriverPtr driver, ...@@ -721,7 +723,7 @@ int qemuSetupCgroupForEmulator(virQEMUDriverPtr driver,
if (priv->cgroup == NULL) if (priv->cgroup == NULL)
return 0; /* Not supported, so claim success */ return 0; /* Not supported, so claim success */
rc = virCgroupForEmulator(priv->cgroup, &cgroup_emulator, 1); rc = virCgroupNewEmulator(priv->cgroup, true, &cgroup_emulator);
if (rc < 0) { if (rc < 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to create emulator cgroup for %s"), _("Unable to create emulator cgroup for %s"),
......
...@@ -3561,7 +3561,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, ...@@ -3561,7 +3561,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
if (priv->cgroup) { if (priv->cgroup) {
int rv = -1; int rv = -1;
/* Create cgroup for the onlined vcpu */ /* Create cgroup for the onlined vcpu */
rv = virCgroupForVcpu(priv->cgroup, i, &cgroup_vcpu, 1); rv = virCgroupNewVcpu(priv->cgroup, i, true, &cgroup_vcpu);
if (rv < 0) { if (rv < 0) {
virReportSystemError(-rv, virReportSystemError(-rv,
_("Unable to create vcpu cgroup for %s(vcpu:" _("Unable to create vcpu cgroup for %s(vcpu:"
...@@ -3635,7 +3635,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, ...@@ -3635,7 +3635,7 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
if (priv->cgroup) { if (priv->cgroup) {
int rv = -1; int rv = -1;
rv = virCgroupForVcpu(priv->cgroup, i, &cgroup_vcpu, 0); rv = virCgroupNewVcpu(priv->cgroup, i, false, &cgroup_vcpu);
if (rv < 0) { if (rv < 0) {
virReportSystemError(-rv, virReportSystemError(-rv,
_("Unable to access vcpu cgroup for %s(vcpu:" _("Unable to access vcpu cgroup for %s(vcpu:"
...@@ -3862,7 +3862,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, ...@@ -3862,7 +3862,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
/* Configure the corresponding cpuset cgroup before set affinity. */ /* Configure the corresponding cpuset cgroup before set affinity. */
if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) { if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
if (virCgroupForVcpu(priv->cgroup, vcpu, &cgroup_vcpu, 0) == 0 && if (virCgroupNewVcpu(priv->cgroup, vcpu, false, &cgroup_vcpu) == 0 &&
qemuSetupCgroupVcpuPin(cgroup_vcpu, newVcpuPin, newVcpuPinNum, vcpu) < 0) { qemuSetupCgroupVcpuPin(cgroup_vcpu, newVcpuPin, newVcpuPinNum, vcpu) < 0) {
virReportError(VIR_ERR_OPERATION_INVALID, virReportError(VIR_ERR_OPERATION_INVALID,
_("failed to set cpuset.cpus in cgroup" _("failed to set cpuset.cpus in cgroup"
...@@ -4124,7 +4124,7 @@ qemuDomainPinEmulator(virDomainPtr dom, ...@@ -4124,7 +4124,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
* Configure the corresponding cpuset cgroup. * Configure the corresponding cpuset cgroup.
* If no cgroup for domain or hypervisor exists, do nothing. * If no cgroup for domain or hypervisor exists, do nothing.
*/ */
if (virCgroupForEmulator(priv->cgroup, &cgroup_emulator, 0) == 0) { if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_emulator) == 0) {
if (qemuSetupCgroupEmulatorPin(cgroup_emulator, if (qemuSetupCgroupEmulatorPin(cgroup_emulator,
newVcpuPin[0]->cpumask) < 0) { newVcpuPin[0]->cpumask) < 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
...@@ -7640,7 +7640,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup, ...@@ -7640,7 +7640,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
*/ */
if (priv->nvcpupids != 0 && priv->vcpupids[0] != vm->pid) { if (priv->nvcpupids != 0 && priv->vcpupids[0] != vm->pid) {
for (i = 0; i < priv->nvcpupids; i++) { for (i = 0; i < priv->nvcpupids; i++) {
rc = virCgroupForVcpu(cgroup, i, &cgroup_vcpu, 0); rc = virCgroupNewVcpu(cgroup, i, false, &cgroup_vcpu);
if (rc < 0) { if (rc < 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to find vcpu cgroup for %s(vcpu:" _("Unable to find vcpu cgroup for %s(vcpu:"
...@@ -7678,7 +7678,7 @@ qemuSetEmulatorBandwidthLive(virDomainObjPtr vm, virCgroupPtr cgroup, ...@@ -7678,7 +7678,7 @@ qemuSetEmulatorBandwidthLive(virDomainObjPtr vm, virCgroupPtr cgroup,
return 0; return 0;
} }
rc = virCgroupForEmulator(cgroup, &cgroup_emulator, 0); rc = virCgroupNewEmulator(cgroup, false, &cgroup_emulator);
if (rc < 0) { if (rc < 0) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to find emulator cgroup for %s"), _("Unable to find emulator cgroup for %s"),
...@@ -7926,7 +7926,7 @@ qemuGetVcpusBWLive(virDomainObjPtr vm, ...@@ -7926,7 +7926,7 @@ qemuGetVcpusBWLive(virDomainObjPtr vm,
} }
/* get period and quota for vcpu0 */ /* get period and quota for vcpu0 */
rc = virCgroupForVcpu(priv->cgroup, 0, &cgroup_vcpu, 0); rc = virCgroupNewVcpu(priv->cgroup, 0, false, &cgroup_vcpu);
if (!cgroup_vcpu) { if (!cgroup_vcpu) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to find vcpu cgroup for %s(vcpu: 0)"), _("Unable to find vcpu cgroup for %s(vcpu: 0)"),
...@@ -7964,7 +7964,7 @@ qemuGetEmulatorBandwidthLive(virDomainObjPtr vm, virCgroupPtr cgroup, ...@@ -7964,7 +7964,7 @@ qemuGetEmulatorBandwidthLive(virDomainObjPtr vm, virCgroupPtr cgroup,
} }
/* get period and quota for emulator */ /* get period and quota for emulator */
rc = virCgroupForEmulator(cgroup, &cgroup_emulator, 0); rc = virCgroupNewEmulator(cgroup, false, &cgroup_emulator);
if (!cgroup_emulator) { if (!cgroup_emulator) {
virReportSystemError(-rc, virReportSystemError(-rc,
_("Unable to find emulator cgroup for %s"), _("Unable to find emulator cgroup for %s"),
...@@ -14148,7 +14148,7 @@ getSumVcpuPercpuStats(virDomainObjPtr vm, ...@@ -14148,7 +14148,7 @@ getSumVcpuPercpuStats(virDomainObjPtr vm,
unsigned long long tmp; unsigned long long tmp;
int j; int j;
if (virCgroupForVcpu(priv->cgroup, i, &group_vcpu, 0) < 0) { if (virCgroupNewVcpu(priv->cgroup, i, false, &group_vcpu) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("error accessing cgroup cpuacct for vcpu")); _("error accessing cgroup cpuacct for vcpu"));
goto cleanup; goto cleanup;
......
...@@ -927,7 +927,7 @@ cleanup: ...@@ -927,7 +927,7 @@ cleanup:
} }
/** /**
* virCgroupForDriver: * virCgroupNewDriver:
* *
* @name: name of this driver (e.g., xen, qemu, lxc) * @name: name of this driver (e.g., xen, qemu, lxc)
* @group: Pointer to returned virCgroupPtr * @group: Pointer to returned virCgroupPtr
...@@ -935,11 +935,11 @@ cleanup: ...@@ -935,11 +935,11 @@ cleanup:
* Returns 0 on success * Returns 0 on success
*/ */
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
int virCgroupForDriver(const char *name, int virCgroupNewDriver(const char *name,
virCgroupPtr *group,
bool privileged, bool privileged,
bool create, bool create,
int controllers) int controllers,
virCgroupPtr *group)
{ {
int rc; int rc;
char *path = NULL; char *path = NULL;
...@@ -970,11 +970,11 @@ out: ...@@ -970,11 +970,11 @@ out:
return rc; return rc;
} }
#else #else
int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED, int virCgroupNewDriver(const char *name ATTRIBUTE_UNUSED,
virCgroupPtr *group ATTRIBUTE_UNUSED,
bool privileged ATTRIBUTE_UNUSED, bool privileged ATTRIBUTE_UNUSED,
bool create ATTRIBUTE_UNUSED, bool create ATTRIBUTE_UNUSED,
int controllers ATTRIBUTE_UNUSED) int controllers ATTRIBUTE_UNUSED,
virCgroupPtr *group ATTRIBUTE_UNUSED)
{ {
/* Claim no support */ /* Claim no support */
return -ENXIO; return -ENXIO;
...@@ -982,7 +982,7 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED, ...@@ -982,7 +982,7 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED,
#endif #endif
/** /**
* virCgroupForSelf: * virCgroupNewSelf:
* *
* @group: Pointer to returned virCgroupPtr * @group: Pointer to returned virCgroupPtr
* *
...@@ -992,19 +992,19 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED, ...@@ -992,19 +992,19 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED,
* Returns 0 on success * Returns 0 on success
*/ */
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
int virCgroupForSelf(virCgroupPtr *group) int virCgroupNewSelf(virCgroupPtr *group)
{ {
return virCgroupNew("/", -1, group); return virCgroupNew("/", -1, group);
} }
#else #else
int virCgroupForSelf(virCgroupPtr *group ATTRIBUTE_UNUSED) int virCgroupNewSelf(virCgroupPtr *group ATTRIBUTE_UNUSED)
{ {
return -ENXIO; return -ENXIO;
} }
#endif #endif
/** /**
* virCgroupForDomain: * virCgroupNewDomain:
* *
* @driver: group for driver owning the domain * @driver: group for driver owning the domain
* @name: name of the domain * @name: name of the domain
...@@ -1013,17 +1013,14 @@ int virCgroupForSelf(virCgroupPtr *group ATTRIBUTE_UNUSED) ...@@ -1013,17 +1013,14 @@ int virCgroupForSelf(virCgroupPtr *group ATTRIBUTE_UNUSED)
* Returns 0 on success * Returns 0 on success
*/ */
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
int virCgroupForDomain(virCgroupPtr driver, int virCgroupNewDomain(virCgroupPtr driver,
const char *name, const char *name,
virCgroupPtr *group, bool create,
bool create) virCgroupPtr *group)
{ {
int rc; int rc;
char *path; char *path;
if (driver == NULL)
return -EINVAL;
if (virAsprintf(&path, "%s/%s", driver->path, name) < 0) if (virAsprintf(&path, "%s/%s", driver->path, name) < 0)
return -ENOMEM; return -ENOMEM;
...@@ -1049,38 +1046,36 @@ int virCgroupForDomain(virCgroupPtr driver, ...@@ -1049,38 +1046,36 @@ int virCgroupForDomain(virCgroupPtr driver,
return rc; return rc;
} }
#else #else
int virCgroupForDomain(virCgroupPtr driver ATTRIBUTE_UNUSED, int virCgroupNewDomain(virCgroupPtr driver ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED, const char *name ATTRIBUTE_UNUSED,
virCgroupPtr *group ATTRIBUTE_UNUSED, bool create ATTRIBUTE_UNUSED,
bool create ATTRIBUTE_UNUSED) virCgroupPtr *group ATTRIBUTE_UNUSED)
{ {
return -ENXIO; return -ENXIO;
} }
#endif #endif
/** /**
* virCgroupForVcpu: * virCgroupNewVcpu:
* *
* @driver: group for the domain * @domain: group for the domain
* @vcpuid: id of the vcpu * @vcpuid: id of the vcpu
* @create: true to create if not already existing
* @group: Pointer to returned virCgroupPtr * @group: Pointer to returned virCgroupPtr
* *
* Returns 0 on success * Returns 0 on success
*/ */
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
int virCgroupForVcpu(virCgroupPtr driver, int virCgroupNewVcpu(virCgroupPtr domain,
int vcpuid, int vcpuid,
virCgroupPtr *group, bool create,
bool create) virCgroupPtr *group)
{ {
int rc; int rc;
char *path; char *path;
int controllers; int controllers;
if (driver == NULL) if (virAsprintf(&path, "%s/vcpu%d", domain->path, vcpuid) < 0)
return -EINVAL;
if (virAsprintf(&path, "%s/vcpu%d", driver->path, vcpuid) < 0)
return -ENOMEM; return -ENOMEM;
controllers = ((1 << VIR_CGROUP_CONTROLLER_CPU) | controllers = ((1 << VIR_CGROUP_CONTROLLER_CPU) |
...@@ -1091,7 +1086,7 @@ int virCgroupForVcpu(virCgroupPtr driver, ...@@ -1091,7 +1086,7 @@ int virCgroupForVcpu(virCgroupPtr driver,
VIR_FREE(path); VIR_FREE(path);
if (rc == 0) { if (rc == 0) {
rc = virCgroupMakeGroup(driver, *group, create, VIR_CGROUP_NONE); rc = virCgroupMakeGroup(domain, *group, create, VIR_CGROUP_NONE);
if (rc != 0) if (rc != 0)
virCgroupFree(group); virCgroupFree(group);
} }
...@@ -1099,36 +1094,34 @@ int virCgroupForVcpu(virCgroupPtr driver, ...@@ -1099,36 +1094,34 @@ int virCgroupForVcpu(virCgroupPtr driver,
return rc; return rc;
} }
#else #else
int virCgroupForVcpu(virCgroupPtr driver ATTRIBUTE_UNUSED, int virCgroupNewVcpu(virCgroupPtr domain ATTRIBUTE_UNUSED,
int vcpuid ATTRIBUTE_UNUSED, int vcpuid ATTRIBUTE_UNUSED,
virCgroupPtr *group ATTRIBUTE_UNUSED, bool create ATTRIBUTE_UNUSED,
bool create ATTRIBUTE_UNUSED) virCgroupPtr *group ATTRIBUTE_UNUSED)
{ {
return -ENXIO; return -ENXIO;
} }
#endif #endif
/** /**
* virCgroupForEmulator: * virCgroupNewEmulator:
* *
* @driver: group for the domain * @domain: group for the domain
* @create: true to create if not already existing
* @group: Pointer to returned virCgroupPtr * @group: Pointer to returned virCgroupPtr
* *
* Returns: 0 on success or -errno on failure * Returns: 0 on success or -errno on failure
*/ */
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
int virCgroupForEmulator(virCgroupPtr driver, int virCgroupNewEmulator(virCgroupPtr domain,
virCgroupPtr *group, bool create,
bool create) virCgroupPtr *group)
{ {
int rc; int rc;
char *path; char *path;
int controllers; int controllers;
if (driver == NULL) if (virAsprintf(&path, "%s/emulator", domain->path) < 0)
return -EINVAL;
if (virAsprintf(&path, "%s/emulator", driver->path) < 0)
return -ENOMEM; return -ENOMEM;
controllers = ((1 << VIR_CGROUP_CONTROLLER_CPU) | controllers = ((1 << VIR_CGROUP_CONTROLLER_CPU) |
...@@ -1139,7 +1132,7 @@ int virCgroupForEmulator(virCgroupPtr driver, ...@@ -1139,7 +1132,7 @@ int virCgroupForEmulator(virCgroupPtr driver,
VIR_FREE(path); VIR_FREE(path);
if (rc == 0) { if (rc == 0) {
rc = virCgroupMakeGroup(driver, *group, create, VIR_CGROUP_NONE); rc = virCgroupMakeGroup(domain, *group, create, VIR_CGROUP_NONE);
if (rc != 0) if (rc != 0)
virCgroupFree(group); virCgroupFree(group);
} }
...@@ -1147,9 +1140,9 @@ int virCgroupForEmulator(virCgroupPtr driver, ...@@ -1147,9 +1140,9 @@ int virCgroupForEmulator(virCgroupPtr driver,
return rc; return rc;
} }
#else #else
int virCgroupForEmulator(virCgroupPtr driver ATTRIBUTE_UNUSED, int virCgroupNewEmulator(virCgroupPtr domain ATTRIBUTE_UNUSED,
virCgroupPtr *group ATTRIBUTE_UNUSED, bool create ATTRIBUTE_UNUSED,
bool create ATTRIBUTE_UNUSED) virCgroupPtr *group ATTRIBUTE_UNUSED)
{ {
return -ENXIO; return -ENXIO;
} }
......
...@@ -44,27 +44,32 @@ enum { ...@@ -44,27 +44,32 @@ enum {
VIR_ENUM_DECL(virCgroupController); VIR_ENUM_DECL(virCgroupController);
int virCgroupForDriver(const char *name, int virCgroupNewDriver(const char *name,
virCgroupPtr *group,
bool privileged, bool privileged,
bool create, bool create,
int controllers); int controllers,
virCgroupPtr *group)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(5);
int virCgroupForSelf(virCgroupPtr *group); int virCgroupNewSelf(virCgroupPtr *group)
ATTRIBUTE_NONNULL(1);
int virCgroupForDomain(virCgroupPtr driver, int virCgroupNewDomain(virCgroupPtr driver,
const char *name, const char *name,
virCgroupPtr *group, bool create,
bool create); virCgroupPtr *group)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
int virCgroupForVcpu(virCgroupPtr driver, int virCgroupNewVcpu(virCgroupPtr domain,
int vcpuid, int vcpuid,
virCgroupPtr *group, bool create,
bool create); virCgroupPtr *group)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
int virCgroupForEmulator(virCgroupPtr driver,
virCgroupPtr *group, int virCgroupNewEmulator(virCgroupPtr domain,
bool create); bool create,
virCgroupPtr *group)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
int virCgroupPathOfController(virCgroupPtr group, int virCgroupPathOfController(virCgroupPtr group,
int controller, int controller,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册