Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-23 Thread Mark Kettenis
> From: "Theo de Raadt" > Date: Fri, 22 May 2020 17:57:37 -0600 > > There is an internal VCPU #define, but the keyword is vcpu, and there > appears to be nothing coming from the system which is an uppercase VCPU > > We don't have pfctl spitting out messages like: invalid RDOMAIN, because > rdoma

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Theo de Raadt
Klemens Nanni wrote: > On Fri, May 22, 2020 at 05:57:37PM -0600, Theo de Raadt wrote: > > There is an internal VCPU #define, but the keyword is vcpu, and there > > appears to be nothing coming from the system which is an uppercase VCPU > > > > We don't have pfctl spitting out messages like: inva

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Theo de Raadt
Klemens Nanni wrote: > On Fri, May 22, 2020 at 05:57:37PM -0600, Theo de Raadt wrote: > > There is an internal VCPU #define, but the keyword is vcpu, and there > > appears to be nothing coming from the system which is an uppercase VCPU > > > > We don't have pfctl spitting out messages like: inva

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Klemens Nanni
On Fri, May 22, 2020 at 05:57:37PM -0600, Theo de Raadt wrote: > There is an internal VCPU #define, but the keyword is vcpu, and there > appears to be nothing coming from the system which is an uppercase VCPU > > We don't have pfctl spitting out messages like: invalid RDOMAIN, because > rdomain is

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Klemens Nanni
On Fri, May 22, 2020 at 05:50:32PM -0600, Theo de Raadt wrote: > Your diff added a new upper case. No, it did not; neither of the two diffs changed any error message, wording or case. Both reordered already existing lines only.

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Theo de Raadt
There is an internal VCPU #define, but the keyword is vcpu, and there appears to be nothing coming from the system which is an uppercase VCPU We don't have pfctl spitting out messages like: invalid RDOMAIN, because rdomain is the keyword, there is no reason to arbitrarily change things from LOWERC

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Theo de Raadt
Klemens Nanni wrote: > On Fri, May 22, 2020 at 05:05:14PM -0600, Theo de Raadt wrote: > > Then why is the grammer keyword lowercase? > Because it's easier to type and practically all grammar keywords in all > of base's *.conf files are lowercase. Your diff added a new upper case. > Send a diff

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Klemens Nanni
On Fri, May 22, 2020 at 05:05:14PM -0600, Theo de Raadt wrote: > Then why is the grammer keyword lowercase? Because it's easier to type and practically all grammar keywords in all of base's *.conf files are lowercase. Send a diff if you want to change stuff.

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Theo de Raadt
Klemens Nanni wrote: > On Fri, May 22, 2020 at 04:39:03PM -0600, Theo de Raadt wrote: > > Why is VCPU upper case? > Probably because it is an abbreviation? Wherever I look, "CPU" is upper > case. ldom.conf(5) says "virutal CPUs", which reads as fine as "VCPUs" > to me - "vcpus" would be off. >

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Klemens Nanni
On Fri, May 22, 2020 at 04:39:03PM -0600, Theo de Raadt wrote: > Why is VCPU upper case? Probably because it is an abbreviation? Wherever I look, "CPU" is upper case. ldom.conf(5) says "virutal CPUs", which reads as fine as "VCPUs" to me - "vcpus" would be off. > I don't see any other place it i

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Kurt Mosiejczuk
On Fri, May 22, 2020 at 04:39:03PM -0600, Theo de Raadt wrote: > Why is VCPU upper case? > I don't see any other place it is upper case. I don't know. It was that way before the change. It's in the file twice as uppercase, both times when using errx(3). It's not used as lowercase when using errx.

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Theo de Raadt
Why is VCPU upper case? I don't see any other place it is upper case. Klemens Nanni wrote: > On Fri, May 22, 2020 at 11:35:34PM +0200, Mark Kettenis wrote: > > That can't be right. We get the number of available CPUs for example > > from the PRI so pri_init() has to be called before we check.

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Klemens Nanni
On Fri, May 22, 2020 at 11:35:34PM +0200, Mark Kettenis wrote: > That can't be right. We get the number of available CPUs for example > from the PRI so pri_init() has to be called before we check. Yup, I fooled myself with poor testing - the commit is already reverted with an explanation. Didn't

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Mark Kettenis
> Date: Fri, 22 May 2020 23:05:21 +0200 > From: Klemens Nanni > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > > > kmos noted that `-n' wouldn't bark at overallocation. > > Hoisting PRI reading and moving the `-n' check after constraint checking > makes it bail on in

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Theo de Raadt
Why upper case? Klemens Nanni wrote: > > > kmos noted that `-n' wouldn't bark at overallocation. > > Hoisting PRI reading and moving the `-n' check after constraint checking > makes it bail on invalid configs just as expected: > > $ cat ldom.conf > domain guest { >

Re: ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Kurt Mosiejczuk
On Fri, May 22, 2020 at 11:05:21PM +0200, Klemens Nanni wrote: > kmos noted that `-n' wouldn't bark at overallocation. > Hoisting PRI reading and moving the `-n' check after constraint checking > makes it bail on invalid configs just as expected: > $ cat ldom.conf > domain guest { >

ldomctl: Make init-sytem -n check vcpu and memory constraints

2020-05-22 Thread Klemens Nanni
kmos noted that `-n' wouldn't bark at overallocation. Hoisting PRI reading and moving the `-n' check after constraint checking makes it bail on invalid configs just as expected: $ cat ldom.conf domain guest { vdisk "/dev/null" vcpu 128