[libvirt] [PATCH] qemu: don't error out when cgroups don't exist

Eric Blake eblake at redhat.com
Wed Jul 9 13:25:45 UTC 2014


On 07/09/2014 02:15 AM, Martin Kletzander wrote:
> When creating cgroups for vcpu and emulator threads whilst starting a
> domain, we explicitly skip creating those cgroups in case priv->cgroup
> is NULL (cgroups not supported) because SetAffinity() serves the same
> purpose.  If the host supports only some cgroups (the ones we need are
> either unmounted or disabled in qemu.conf), we error out with weird
> message even though we could continue starting the domain.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1097028
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
>  src/qemu/qemu_cgroup.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
> index 3394c68..0af6ac5 100644
> --- a/src/qemu/qemu_cgroup.c
> +++ b/src/qemu/qemu_cgroup.c
> @@ -949,7 +949,11 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm)
>          virCgroupFree(&cgroup_vcpu);
>      }
> 
> -    return -1;
> +    if (period || quota)
> +        return -1;
> +
> +    virResetLastError();
> +    return 0;

This still leaks the error message to the log, even if we proceed with
execution. Checking up front is better than clearing errors after the
fact, if that is possible.


-- 
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: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140709/f69c1a48/attachment-0001.sig>


More information about the libvir-list mailing list