On 04/10/2013 04:08 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
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: Daniel P. Berrange <berrange(a)redhat.com>
---
src/libvirt_private.syms | 10 +++---
src/lxc/lxc_cgroup.c | 6 ++--
src/qemu/qemu_cgroup.c | 14 ++++----
src/qemu/qemu_driver.c | 18 +++++------
src/util/vircgroup.c | 84 ++++++++++++++++++++++--------------------------
src/util/vircgroup.h | 33 +++++++++++--------
6 files changed, 82 insertions(+), 83 deletions(-)
@@ -935,11 +935,11 @@ cleanup:
* Returns 0 on success
*/
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
-int virCgroupForDriver(const char *name,
- virCgroupPtr *group,
+int virCgroupNewDriver(const char *name,
Is it worth formatting like
int
virCgroupNewDriver(...
as long as you are touching that?
/**
- * virCgroupForVcpu:
+ * virCgroupNewVcpu:
*
- * @driver: group for the domain
+ * @domain: group for the domain
* @vcpuid: id of the vcpu
* @group: Pointer to returned virCgroupPtr
This documents 3 arguments,
*
* Returns 0 on success
*/
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
-int virCgroupForVcpu(virCgroupPtr driver,
+int virCgroupNewVcpu(virCgroupPtr domain,
int vcpuid,
- virCgroupPtr *group,
- bool create)
+ bool create,
+ virCgroupPtr *group)
even though there are 4 here. Missing @create.
/**
- * virCgroupForEmulator:
+ * virCgroupNewEmulator:
*
- * @driver: group for the domain
+ * @domain: group for the domain
* @group: Pointer to returned virCgroupPtr
*
* Returns: 0 on success or -errno on failure
*/
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
-int virCgroupForEmulator(virCgroupPtr driver,
- virCgroupPtr *group,
- bool create)
Again, missing @create docs.
ACK, whether or not you fix up my minor findings now or in a later patch.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org