[libvirt] [PATCH 5/5] util: vircgroupv2: don't error out if enabling controller fails

Pavel Hrdina phrdina at redhat.com
Fri Jun 21 13:16:35 UTC 2019


On Fri, Jun 21, 2019 at 11:58:16AM +0200, Ján Tomko wrote:
> On Thu, Jun 20, 2019 at 01:25:45PM +0200, Pavel Hrdina wrote:
> > Currently CPU controller cannot be enabled if there is any real-time
> > task running and is assigned to non-root cgroup which is the case on
> > several distributions with graphical environment.
> > 
> > Instead of erroring out treat it as the controller is not available.
> > 
> > Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> > ---
> > src/util/vircgroupv2.c | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
> > index 6eeebe2230..9cc64d64d2 100644
> > --- a/src/util/vircgroupv2.c
> > +++ b/src/util/vircgroupv2.c
> > @@ -425,8 +425,13 @@ virCgroupV2MakeGroup(virCgroupPtr parent ATTRIBUTE_UNUSED,
> >                 if (i == VIR_CGROUP_CONTROLLER_CPUACCT)
> >                     continue;
> > 
> > -                if (virCgroupV2EnableController(parent, i) < 0)
> > -                    return -1;
> > +                if (virCgroupV2EnableController(parent, i) < 0) {
> > +                    virResetLastError();
> 
> If it's not an error, we should not have logged it in the first place.

After discussion in person we will keep the error message logged but
I'll rewrite it a little bit to have a better error message.

I'll post v2 shortly, thanks for review.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190621/d666ccc7/attachment-0001.sig>


More information about the libvir-list mailing list