[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/3] Ensure all cgroup partitions have a suffix of ".partition"



On 04/26/2013 04:45 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange redhat com>
> 
> If the partition named passed in the XML does not already have
> a suffix, ensure it gets a '.partition' added to each component.
> The exceptions are /machine, /user and /system which do not need
> to have a suffix, since they are fixed partitions at the top
> level.
> 
> Signed-off-by: Daniel P. Berrange <berrange redhat com>
> ---
>  src/util/vircgroup.c  |  57 +++++++++++++++++++++--
>  tests/vircgrouptest.c | 123 ++++++++++++++++++++++++++++++++++++--------------
>  2 files changed, 143 insertions(+), 37 deletions(-)
> 

> -    rc = virCgroupNew(path, NULL, controllers, group);
> +    /* XXX convert all cgroups APIs to use error report
> +     * APIs instead of returning errno */
> +    if (!(newpath = virCgroupSetPartitionSuffix(path))) {
> +        virResetLastError();
> +        rc = -ENOMEM;
> +        goto cleanup;
> +    }

Yeah, I can see why you added that comment.  But I looked through all
the code paths, and looks like the only error possible is OOM, so your
conversion of failure back to errno is correct.

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]