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

Eric Blake eblake at redhat.com
Fri Apr 26 11:23:40 UTC 2013


On 04/26/2013 04:45 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at 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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130426/63898da3/attachment-0001.sig>


More information about the libvir-list mailing list