Domains get to define their cores and memory only once unlike the other
parameters of which it makes sense to have more than one.
$ cat dup.conf
domain primary {
vcpu 2
vcpu 2
}
$ ldomctl init-system -n dup.conf ; echo $?
0
$ ./obj/ldomctl init-system -n dup.conf
dup.conf:3 duplicate vcpu option
OK?
Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/parse.y,v
retrieving revision 1.13
diff -u -p -r1.13 parse.y
--- parse.y 28 Nov 2019 18:40:42 -0000 1.13
+++ parse.y 5 Jan 2020 18:03:54 -0000
@@ -138,10 +155,18 @@ domainoptsl : domainopts nl
;
domainopts : VCPU vcpu {
+ if (domain->vcpu) {
+ yyerror("duplicate vcpu option");
+ YYERROR;
+ }
domain->vcpu = $2.count;
domain->vcpu_stride = $2.stride;
}
| MEMORY memory {
+ if (domain->memory) {
+ yyerror("duplicate memory option");
+ YYERROR;
+ }
domain->memory = $2;
}
| VDISK STRING {