[libvirt] [PATCH 13/13] Enable support for systemd-machined in cgroups creation

Eric Blake eblake at redhat.com
Tue Jul 23 22:01:56 UTC 2013


On 07/23/2013 09:21 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Make the virCgroupNewMachine method try to use systemd-machined
> first. If that fails, then fallback to using the traditional
> cgroup setup code path.
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/util/vircgroup.c  | 115 ++++++++++++++++++++++++++++++++++++++++++++------
>  src/util/virsystemd.c |   8 +++-
>  2 files changed, 108 insertions(+), 15 deletions(-)
> 

> @@ -108,6 +110,13 @@ bool virCgroupIsValidMachineGroup(virCgroupPtr group,
>      if (virCgroupPartitionEscape(&partname) < 0)
>          goto cleanup;
>      
> +    if (virAsprintf(&scopename, "machine-%s\\x2d%s.scope",

A partially-escaped name (the \\x2d is an escape, but the %s are raw)...

> +                    drivername, name) < 0)
> +        goto cleanup;
> +
> +    if (virCgroupPartitionEscape(&scopename) < 0)

...re-escaped.  Is this going to do the right thing, or are you causing
too many \ in the resulting string by over-escaping the separator?

As you said in the cover letter, this is a preview while you are still
hammering out issues, but I'm okay with the rest of the series going in
before freeze.

-- 
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/20130723/5baa3e5e/attachment-0001.sig>


More information about the libvir-list mailing list