diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-09-16 14:27:33 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-09-16 14:27:33 +0000 |
commit | 11cf6a06536dcd3c88403b956110c2aa3c3105ec (patch) | |
tree | 045b10e3a5f8945c7ad09dbc891cb9e0e6800a49 /usr.sbin/ldomctl/parse.y | |
parent | bb9ef0a587d30cde6b00373c047aa091c17afd00 (diff) |
Add support for setting NVRAM variables.
Diffstat (limited to 'usr.sbin/ldomctl/parse.y')
-rw-r--r-- | usr.sbin/ldomctl/parse.y | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/ldomctl/parse.y b/usr.sbin/ldomctl/parse.y index edcb0869e55..359ff9a9e81 100644 --- a/usr.sbin/ldomctl/parse.y +++ b/usr.sbin/ldomctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.7 2018/07/09 12:05:11 krw Exp $ */ +/* $OpenBSD: parse.y,v 1.8 2018/09/16 14:27:32 kettenis Exp $ */ /* * Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org> @@ -82,7 +82,7 @@ typedef struct { %} %token DOMAIN -%token VCPU MEMORY VDISK VNET +%token VCPU MEMORY VDISK VNET VARIABLE %token MAC_ADDR MTU %token ERROR %token <v.string> STRING @@ -104,6 +104,7 @@ domain : DOMAIN STRING optnl '{' optnl { domain->name = $2; SIMPLEQ_INIT(&domain->vdisk_list); SIMPLEQ_INIT(&domain->vnet_list); + SIMPLEQ_INIT(&domain->var_list); } domainopts_l '}' { /* domain names need to be unique. */ @@ -142,6 +143,12 @@ domainopts : VCPU NUMBER { vnet->mtu = $2.mtu; SIMPLEQ_INSERT_TAIL(&domain->vnet_list, vnet, entry); } + | VARIABLE STRING '=' STRING { + struct var *var = xmalloc(sizeof(struct var)); + var->name = $2; + var->str = $4; + SIMPLEQ_INSERT_TAIL(&domain->var_list, var, entry); + } ; vnet_opts : { opts_default(); } @@ -253,6 +260,7 @@ lookup(char *s) { "mac-addr", MAC_ADDR}, { "memory", MEMORY}, { "mtu", MTU}, + { "variable", VARIABLE}, { "vcpu", VCPU}, { "vdisk", VDISK}, { "vnet", VNET} |