diff options
Diffstat (limited to 'usr.sbin/ldomctl/parse.y')
-rw-r--r-- | usr.sbin/ldomctl/parse.y | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/ldomctl/parse.y b/usr.sbin/ldomctl/parse.y index b688fcbf930..dfe97a7af66 100644 --- a/usr.sbin/ldomctl/parse.y +++ b/usr.sbin/ldomctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.20 2020/05/23 13:19:13 kn Exp $ */ +/* $OpenBSD: parse.y,v 1.21 2020/06/29 17:58:58 kn Exp $ */ /* * Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org> @@ -181,12 +181,22 @@ domainopts : VCPU vcpu { domain->memory = $2; } | VDISK STRING vdisk_opts { + if (strcmp(domain->name, "primary") == 0) { + yyerror("vdisk option invalid for primary" + " domain"); + YYERROR; + } struct vdisk *vdisk = xmalloc(sizeof(struct vdisk)); vdisk->path = $2; vdisk->devalias = $3.devalias; SIMPLEQ_INSERT_TAIL(&domain->vdisk_list, vdisk, entry); } | VNET vnet_opts { + if (strcmp(domain->name, "primary") == 0) { + yyerror("vnet option invalid for primary" + " domain"); + YYERROR; + } struct vnet *vnet = xmalloc(sizeof(struct vnet)); vnet->mac_addr = $2.mac_addr; vnet->mtu = $2.mtu; @@ -200,6 +210,11 @@ domainopts : VCPU vcpu { SIMPLEQ_INSERT_TAIL(&domain->var_list, var, entry); } | IODEVICE STRING { + if (strcmp(domain->name, "primary") == 0) { + yyerror("iodevice option invalid for primary" + " domain"); + YYERROR; + } struct domain *odomain; struct iodev *iodev; SIMPLEQ_FOREACH(odomain, &conf->domain_list, entry) |