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

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Klemens Nanni-2

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
                memory 1G
        }
        $ ldomctl init-sytem -n ldom.conf ; echo $?
        0
        $ ./obj/ldomctl init-sytem -n ldom.conf
        ldomctl: not enough VCPU resources available


OK?


Index: config.c
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
retrieving revision 1.36
diff -u -p -r1.36 config.c
--- config.c 17 Mar 2020 21:24:22 -0000 1.36
+++ config.c 22 May 2020 21:01:17 -0000
@@ -2792,18 +2798,6 @@ build_config(const char *filename, int n
  SIMPLEQ_INIT(&conf.domain_list);
  if (parse_config(filename, &conf) < 0)
  exit(1);
- if (noaction)
- exit(0);
-
- pri = md_read("pri");
- if (pri == NULL)
- err(1, "unable to get PRI");
- hvmd = md_read("hv.md");
- if (hvmd == NULL)
- err(1, "unable to get Hypervisor MD");
-
- pri_init(pri);
- pri_alloc_memory(hv_membase, hv_memsize);
 
  SIMPLEQ_FOREACH(domain, &conf.domain_list, entry) {
  if (strcmp(domain->name, "primary") == 0) {
@@ -2822,6 +2816,19 @@ build_config(const char *filename, int n
  errx(1, "not enough VCPU resources available");
  if (memory > total_memory || primary_memory == 0)
  errx(1, "not enough memory available");
+
+ if (noaction)
+ exit(0);
+
+ pri = md_read("pri");
+ if (pri == NULL)
+ err(1, "unable to get PRI");
+ hvmd = md_read("hv.md");
+ if (hvmd == NULL)
+ err(1, "unable to get Hypervisor MD");
+
+ pri_init(pri);
+ pri_alloc_memory(hv_membase, hv_memsize);
 
  hvmd_init(hvmd);
  primary = primary_init();

Reply | Threaded
Open this post in threaded view
|

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

Kurt Mosiejczuk-9
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 {
> vdisk "/dev/null"
> vcpu 128
> memory 1G
> }
> $ ldomctl init-sytem -n ldom.conf ; echo $?
> 0
> $ ./obj/ldomctl init-sytem -n ldom.conf
> ldomctl: not enough VCPU resources available

> OK?

Tested and works for me.

ok kmos

--Kurt

>
> Index: config.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
> retrieving revision 1.36
> diff -u -p -r1.36 config.c
> --- config.c 17 Mar 2020 21:24:22 -0000 1.36
> +++ config.c 22 May 2020 21:01:17 -0000
> @@ -2792,18 +2798,6 @@ build_config(const char *filename, int n
>   SIMPLEQ_INIT(&conf.domain_list);
>   if (parse_config(filename, &conf) < 0)
>   exit(1);
> - if (noaction)
> - exit(0);
> -
> - pri = md_read("pri");
> - if (pri == NULL)
> - err(1, "unable to get PRI");
> - hvmd = md_read("hv.md");
> - if (hvmd == NULL)
> - err(1, "unable to get Hypervisor MD");
> -
> - pri_init(pri);
> - pri_alloc_memory(hv_membase, hv_memsize);
>  
>   SIMPLEQ_FOREACH(domain, &conf.domain_list, entry) {
>   if (strcmp(domain->name, "primary") == 0) {
> @@ -2822,6 +2816,19 @@ build_config(const char *filename, int n
>   errx(1, "not enough VCPU resources available");
>   if (memory > total_memory || primary_memory == 0)
>   errx(1, "not enough memory available");
> +
> + if (noaction)
> + exit(0);
> +
> + pri = md_read("pri");
> + if (pri == NULL)
> + err(1, "unable to get PRI");
> + hvmd = md_read("hv.md");
> + if (hvmd == NULL)
> + err(1, "unable to get Hypervisor MD");
> +
> + pri_init(pri);
> + pri_alloc_memory(hv_membase, hv_memsize);
>  
>   hvmd_init(hvmd);
>   primary = primary_init();
>

Reply | Threaded
Open this post in threaded view
|

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

Theo de Raadt-2
In reply to this post by Klemens Nanni-2
Why upper case?


Klemens Nanni <[hidden email]> 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 {
> vdisk "/dev/null"
> vcpu 128
> memory 1G
> }
> $ ldomctl init-sytem -n ldom.conf ; echo $?
> 0
> $ ./obj/ldomctl init-sytem -n ldom.conf
> ldomctl: not enough VCPU resources available
>
>
> OK?
>
>
> Index: config.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
> retrieving revision 1.36
> diff -u -p -r1.36 config.c
> --- config.c 17 Mar 2020 21:24:22 -0000 1.36
> +++ config.c 22 May 2020 21:01:17 -0000
> @@ -2792,18 +2798,6 @@ build_config(const char *filename, int n
>   SIMPLEQ_INIT(&conf.domain_list);
>   if (parse_config(filename, &conf) < 0)
>   exit(1);
> - if (noaction)
> - exit(0);
> -
> - pri = md_read("pri");
> - if (pri == NULL)
> - err(1, "unable to get PRI");
> - hvmd = md_read("hv.md");
> - if (hvmd == NULL)
> - err(1, "unable to get Hypervisor MD");
> -
> - pri_init(pri);
> - pri_alloc_memory(hv_membase, hv_memsize);
>  
>   SIMPLEQ_FOREACH(domain, &conf.domain_list, entry) {
>   if (strcmp(domain->name, "primary") == 0) {
> @@ -2822,6 +2816,19 @@ build_config(const char *filename, int n
>   errx(1, "not enough VCPU resources available");
>   if (memory > total_memory || primary_memory == 0)
>   errx(1, "not enough memory available");
> +
> + if (noaction)
> + exit(0);
> +
> + pri = md_read("pri");
> + if (pri == NULL)
> + err(1, "unable to get PRI");
> + hvmd = md_read("hv.md");
> + if (hvmd == NULL)
> + err(1, "unable to get Hypervisor MD");
> +
> + pri_init(pri);
> + pri_alloc_memory(hv_membase, hv_memsize);
>  
>   hvmd_init(hvmd);
>   primary = primary_init();
>

Reply | Threaded
Open this post in threaded view
|

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

Mark Kettenis
In reply to this post by Klemens Nanni-2
> Date: Fri, 22 May 2020 23:05:21 +0200
> From: Klemens Nanni <[hidden email]>
> 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 invalid configs just as expected:
>
> $ cat ldom.conf
> domain guest {
> vdisk "/dev/null"
> vcpu 128
> memory 1G
> }
> $ ldomctl init-sytem -n ldom.conf ; echo $?
> 0
> $ ./obj/ldomctl init-sytem -n ldom.conf
> ldomctl: not enough VCPU resources available
>
>
> OK?

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.

> Index: config.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
> retrieving revision 1.36
> diff -u -p -r1.36 config.c
> --- config.c 17 Mar 2020 21:24:22 -0000 1.36
> +++ config.c 22 May 2020 21:01:17 -0000
> @@ -2792,18 +2798,6 @@ build_config(const char *filename, int n
>   SIMPLEQ_INIT(&conf.domain_list);
>   if (parse_config(filename, &conf) < 0)
>   exit(1);
> - if (noaction)
> - exit(0);
> -
> - pri = md_read("pri");
> - if (pri == NULL)
> - err(1, "unable to get PRI");
> - hvmd = md_read("hv.md");
> - if (hvmd == NULL)
> - err(1, "unable to get Hypervisor MD");
> -
> - pri_init(pri);
> - pri_alloc_memory(hv_membase, hv_memsize);
>  
>   SIMPLEQ_FOREACH(domain, &conf.domain_list, entry) {
>   if (strcmp(domain->name, "primary") == 0) {
> @@ -2822,6 +2816,19 @@ build_config(const char *filename, int n
>   errx(1, "not enough VCPU resources available");
>   if (memory > total_memory || primary_memory == 0)
>   errx(1, "not enough memory available");
> +
> + if (noaction)
> + exit(0);
> +
> + pri = md_read("pri");
> + if (pri == NULL)
> + err(1, "unable to get PRI");
> + hvmd = md_read("hv.md");
> + if (hvmd == NULL)
> + err(1, "unable to get Hypervisor MD");
> +
> + pri_init(pri);
> + pri_alloc_memory(hv_membase, hv_memsize);
>  
>   hvmd_init(hvmd);
>   primary = primary_init();
>
>

Reply | Threaded
Open this post in threaded view
|

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

Klemens Nanni-2
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 want to rush anything.

Here's version two that merely moves the "-n" check after the constraint
checks;  pri_init() continues to be called before using either of
`total_cpus' or `total_memory'.

        $ cat ldom.conf
        domain guest {
                vdisk "/dev/null"
                vcpu 1
                memory 1G
        }
        $ ./obj/ldomctl init-system -n ldom.conf ; echo $?
        0
        $ sed -i /memory/s,1,128, ldom.conf        
        $ ./obj/ldomctl init-system -n ldom.conf
        ldomctl: not enough memory available
        $ sed -i /cpu/s,1,128, ldom.conf        
        $ ./obj/ldomctl init-system -n ldom.conf
        ldomctl: not enough VCPU resources available


Feedback? OK?


Index: config.c
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
retrieving revision 1.36
diff -u -p -r1.36 config.c
--- config.c 17 Mar 2020 21:24:22 -0000 1.36
+++ config.c 22 May 2020 22:11:59 -0000
@@ -2792,8 +2798,6 @@ build_config(const char *filename, int n
  SIMPLEQ_INIT(&conf.domain_list);
  if (parse_config(filename, &conf) < 0)
  exit(1);
- if (noaction)
- exit(0);
 
  pri = md_read("pri");
  if (pri == NULL)
@@ -2822,6 +2826,9 @@ build_config(const char *filename, int n
  errx(1, "not enough VCPU resources available");
  if (memory > total_memory || primary_memory == 0)
  errx(1, "not enough memory available");
+
+ if (noaction)
+ exit(0);
 
  hvmd_init(hvmd);
  primary = primary_init();

Reply | Threaded
Open this post in threaded view
|

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

Theo de Raadt-2
Why is VCPU upper case?

I don't see any other place it is upper case.


Klemens Nanni <[hidden email]> 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.
> Yup, I fooled myself with poor testing - the commit is already reverted
> with an explanation.  Didn't want to rush anything.
>
> Here's version two that merely moves the "-n" check after the constraint
> checks;  pri_init() continues to be called before using either of
> `total_cpus' or `total_memory'.
>
> $ cat ldom.conf
> domain guest {
> vdisk "/dev/null"
> vcpu 1
> memory 1G
> }
> $ ./obj/ldomctl init-system -n ldom.conf ; echo $?
> 0
> $ sed -i /memory/s,1,128, ldom.conf        
> $ ./obj/ldomctl init-system -n ldom.conf
> ldomctl: not enough memory available
> $ sed -i /cpu/s,1,128, ldom.conf        
> $ ./obj/ldomctl init-system -n ldom.conf
> ldomctl: not enough VCPU resources available
>
>
> Feedback? OK?
>
>
> Index: config.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
> retrieving revision 1.36
> diff -u -p -r1.36 config.c
> --- config.c 17 Mar 2020 21:24:22 -0000 1.36
> +++ config.c 22 May 2020 22:11:59 -0000
> @@ -2792,8 +2798,6 @@ build_config(const char *filename, int n
>   SIMPLEQ_INIT(&conf.domain_list);
>   if (parse_config(filename, &conf) < 0)
>   exit(1);
> - if (noaction)
> - exit(0);
>  
>   pri = md_read("pri");
>   if (pri == NULL)
> @@ -2822,6 +2826,9 @@ build_config(const char *filename, int n
>   errx(1, "not enough VCPU resources available");
>   if (memory > total_memory || primary_memory == 0)
>   errx(1, "not enough memory available");
> +
> + if (noaction)
> + exit(0);
>  
>   hvmd_init(hvmd);
>   primary = primary_init();
>

Reply | Threaded
Open this post in threaded view
|

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

Kurt Mosiejczuk-9
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. It has been that way for 7+ years. It can easily be
changed though.

--Kurt

Reply | Threaded
Open this post in threaded view
|

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

Klemens Nanni-2
In reply to this post by Theo de Raadt-2
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 is upper case.

        $ cvs blame config.c |grep VCPU
        Annotations for config.c
        ***************
        1.11         (kettenis 01-Dec-12):                              errx(1, "couldn't determine core for VCPU %lld\n", pid);
        1.2          (kettenis 24-Nov-12):              errx(1, "not enough VCPU resources available");

Reply | Threaded
Open this post in threaded view
|

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

Theo de Raadt-2
Klemens Nanni <[hidden email]> 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.
>
> > I don't see any other place it is upper case.
>
> $ cvs blame config.c |grep VCPU
> Annotations for config.c
> ***************
> 1.11         (kettenis 01-Dec-12):                              errx(1, "couldn't determine core for VCPU %lld\n", pid);
> 1.2          (kettenis 24-Nov-12):              errx(1, "not enough VCPU resources available");
>

Then why is the grammer keyword lowercase?

Come on.

Reply | Threaded
Open this post in threaded view
|

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

Klemens Nanni-2
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.

Reply | Threaded
Open this post in threaded view
|

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

Theo de Raadt-2
Klemens Nanni <[hidden email]> 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 if you want to change stuff.

The diff you didn't wait for OK's

the diff you commited

The diff you needed to back out.

Want attitude?

Reply | Threaded
Open this post in threaded view
|

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

Theo de Raadt-2
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 LOWERCASE to UPPERCASE or even CamelCase.

That's why I asked twice.

Index: config.c
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
retrieving revision 1.38
diff -u -p -u -r1.38 config.c
--- config.c 22 May 2020 21:54:20 -0000 1.38
+++ config.c 22 May 2020 23:53:34 -0000
@@ -162,7 +162,7 @@ pri_link_core(struct md *md, struct md_n
 
  cpu = pri_find_cpu(pid);
  if (cpu == NULL)
- errx(1, "couldn't determine core for VCPU %lld\n", pid);
+ errx(1, "couldn't determine core for vcpu %lld\n", pid);
  cpu->core = core;
  }
  }
@@ -2819,7 +2819,7 @@ build_config(const char *filename, int n
  if (primary_memory == 0 && total_memory > memory)
  primary_memory = total_memory - memory;
  if (num_cpus > total_cpus || primary_num_cpus == 0)
- errx(1, "not enough VCPU resources available");
+ errx(1, "not enough vcpu resources available");
  if (memory > total_memory || primary_memory == 0)
  errx(1, "not enough memory available");
 

Reply | Threaded
Open this post in threaded view
|

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

Klemens Nanni-2
In reply to this post by Theo de Raadt-2
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.

Reply | Threaded
Open this post in threaded view
|

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

Klemens Nanni-2
In reply to this post by Theo de Raadt-2
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 the keyword, there is no reason to arbitrarily change things
> from LOWERCASE to UPPERCASE or even CamelCase.
Yes, although those error messages read fine to me with uppercase "VCPU"
as well, regardless of whether the keyword is "vcpu" or "cpu", because
they talk about the resources per se that are managed, not a particular
line in the configuration file that is ill written.

Fine with me either way.

Reply | Threaded
Open this post in threaded view
|

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

Theo de Raadt-2
Klemens Nanni <[hidden email]> 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: invalid RDOMAIN, because
> > rdomain is the keyword, there is no reason to arbitrarily change things
> > from LOWERCASE to UPPERCASE or even CamelCase.
> Yes, although those error messages read fine to me with uppercase "VCPU"
> as well, regardless of whether the keyword is "vcpu" or "cpu", because
> they talk about the resources per se that are managed, not a particular
> line in the configuration file that is ill written.

That makes no sense.

> Fine with me either way.

Really? Then how about this?

Obvious DOMAIN refers to the resources, and so does MEMORY.  Obviously
these have nothing to do with the grammer.  Anyone will be able to
figure it out.  Right?

Index: config.c
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
retrieving revision 1.38
diff -u -p -u -r1.38 config.c
--- config.c 22 May 2020 21:54:20 -0000 1.38
+++ config.c 22 May 2020 23:53:34 -0000
Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/parse.y,v
retrieving revision 1.18
diff -u -p -u -r1.18 parse.y
--- parse.y 21 Feb 2020 19:39:28 -0000 1.18
+++ parse.y 23 May 2020 00:26:30 -0000
@@ -123,7 +123,7 @@ domain : DOMAIN STRING optnl '{' optnl
  struct domain *odomain;
  SIMPLEQ_FOREACH(odomain, &conf->domain_list, entry)
  if (strcmp(odomain->name, $2) == 0) {
- yyerror("duplicate domain name: %s", $2);
+ yyerror("duplicate DOMAIN name: %s", $2);
  YYERROR;
  }
  domain = xzalloc(sizeof(struct domain));
@@ -141,7 +141,7 @@ domain : DOMAIN STRING optnl '{' optnl
  YYERROR;
  }
  if ( domain->memory == 0) {
- yyerror("memory is required: %s",
+ yyerror("MEMORY is required: %s",
     domain->name);
  YYERROR;
  }

Reply | Threaded
Open this post in threaded view
|

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

Theo de Raadt-2
In reply to this post by Klemens Nanni-2
Klemens Nanni <[hidden email]> 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: invalid RDOMAIN, because
> > rdomain is the keyword, there is no reason to arbitrarily change things
> > from LOWERCASE to UPPERCASE or even CamelCase.
> Yes, although those error messages read fine to me with uppercase "VCPU"
> as well, regardless of whether the keyword is "vcpu" or "cpu", because
> they talk about the resources per se that are managed, not a particular
> line in the configuration file that is ill written.

I think your argument is completely hopeless.

My comment is about UPPERCASE vs lowercase.

Not about whether it is cpu or vcpu.  But about UPPERCASE.

Why not make it VcPu then?

You are trying to defend an arbitrary difference.

Reply | Threaded
Open this post in threaded view
|

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

Mark Kettenis
In reply to this post by Theo de Raadt-2
> From: "Theo de Raadt" <[hidden email]>
> 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
> rdomain is the keyword, there is no reason to arbitrarily change things
> from LOWERCASE to UPPERCASE or even CamelCase.
>
> That's why I asked twice.

The error message is not referring to the keyword.  It is saying in
plain english that the configuration you created isn't correct because
it exceeds the available rsources.  In plain english we spell CPU with
capital letters becuse it is an abreviation.  So VCPU gets spelled the
same way.

>
> Index: config.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
> retrieving revision 1.38
> diff -u -p -u -r1.38 config.c
> --- config.c 22 May 2020 21:54:20 -0000 1.38
> +++ config.c 22 May 2020 23:53:34 -0000
> @@ -162,7 +162,7 @@ pri_link_core(struct md *md, struct md_n
>  
>   cpu = pri_find_cpu(pid);
>   if (cpu == NULL)
> - errx(1, "couldn't determine core for VCPU %lld\n", pid);
> + errx(1, "couldn't determine core for vcpu %lld\n", pid);
>   cpu->core = core;
>   }
>   }
> @@ -2819,7 +2819,7 @@ build_config(const char *filename, int n
>   if (primary_memory == 0 && total_memory > memory)
>   primary_memory = total_memory - memory;
>   if (num_cpus > total_cpus || primary_num_cpus == 0)
> - errx(1, "not enough VCPU resources available");
> + errx(1, "not enough vcpu resources available");
>   if (memory > total_memory || primary_memory == 0)
>   errx(1, "not enough memory available");
>  
>
>