On Tue, 2021-03-09 at 12:43 +0100, Michal Privoznik wrote:
> On 3/5/21 8:13 PM, Andrea Bolognani wrote:
> > +if (!g_file_get_contents(procfile, , , NULL))
> > +return -1;
>
> I did not spot this yesterday, but now I'm working on a something else
> and have to read a contents of a
On 3/5/21 8:13 PM, Andrea Bolognani wrote:
Calling prlimit() requires elevated privileges, specifically
CAP_SYS_RESOURCE, and getrlimit() only works for the current
process which is too limiting for our needs; /proc/$pid/limits,
on the other hand, can be read by any process, so implement
parsing
On Mon, Mar 08, 2021 at 04:21:16PM +0100, Andrea Bolognani wrote:
> On Mon, 2021-03-08 at 10:50 +, Daniel P. Berrangé wrote:
> > On Fri, Mar 05, 2021 at 08:13:59PM +0100, Andrea Bolognani wrote:
> > > +if (!(label = virProcessLimitResourceToLabel(resource))) {
> > > +
On Mon, 2021-03-08 at 10:50 +, Daniel P. Berrangé wrote:
> On Fri, Mar 05, 2021 at 08:13:59PM +0100, Andrea Bolognani wrote:
> > +if (!(label = virProcessLimitResourceToLabel(resource))) {
> > +virReportError(VIR_ERR_INTERNAL_ERROR,
> > + _("Unknown resource
On Mon, 2021-03-08 at 11:30 +0100, Michal Privoznik wrote:
> On 3/5/21 8:13 PM, Andrea Bolognani wrote:
> > +if (!STRPREFIX(line, label))
> > +continue;
> > +
> > +line += strlen(label);
>
> Or if (!(line = STRSKIP(line, label)) continue;
Oh, I didn't know that
On Fri, Mar 05, 2021 at 08:13:59PM +0100, Andrea Bolognani wrote:
> Calling prlimit() requires elevated privileges, specifically
> CAP_SYS_RESOURCE, and getrlimit() only works for the current
> process which is too limiting for our needs; /proc/$pid/limits,
> on the other hand, can be read by any
On 3/5/21 8:13 PM, Andrea Bolognani wrote:
Calling prlimit() requires elevated privileges, specifically
CAP_SYS_RESOURCE, and getrlimit() only works for the current
process which is too limiting for our needs; /proc/$pid/limits,
on the other hand, can be read by any process, so implement
parsing
Calling prlimit() requires elevated privileges, specifically
CAP_SYS_RESOURCE, and getrlimit() only works for the current
process which is too limiting for our needs; /proc/$pid/limits,
on the other hand, can be read by any process, so implement
parsing that file as a fallback for when prlimit()