-/* $OpenBSD: config.c,v 1.42 2021/01/31 05:14:24 deraadt Exp $ */
+/* $OpenBSD: config.c,v 1.43 2022/10/06 21:35:52 kn Exp $ */
/*
* Copyright (c) 2012, 2018 Mark Kettenis
}
void
-guest_add_iodev(struct guest *guest, const char *path)
+guest_add_iodev(struct guest *guest, const char *dev)
{
struct component *component;
struct subdevice *subdevice;
errx(1, "direct I/O not supported by hypervisor");
TAILQ_FOREACH(component, &components, link) {
- if (strcmp(component->path, path) == 0)
+ if (strcmp(component->nac, dev) == 0 ||
+ strcmp(component->path, dev) == 0)
break;
}
if (component == NULL)
- errx(1, "incorrect device path %s", path);
+ errx(1, "incorrect device path %s", dev);
if (component->assigned)
- errx(1, "device path %s already assigned", path);
+ errx(1, "device path %s already assigned", dev);
subdevice = xzalloc(sizeof(*subdevice));
- subdevice->path = path;
+ subdevice->path = component->path;
TAILQ_INSERT_TAIL(&guest->subdevice_list, subdevice, link);
component->assigned = 1;
}
SIMPLEQ_FOREACH(var, &domain->var_list, entry)
guest_add_variable(guest, var->name, var->str);
SIMPLEQ_FOREACH(iodev, &domain->iodev_list, entry)
- guest_add_iodev(guest, iodev->path);
+ guest_add_iodev(guest, iodev->dev);
guest_finalize(guest);
}
-.\" $OpenBSD: ldom.conf.5,v 1.17 2022/03/31 17:27:30 naddy Exp $
+.\" $OpenBSD: ldom.conf.5,v 1.18 2022/10/06 21:35:52 kn Exp $
.\"
.\" Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: March 31 2022 $
+.Dd $Mdocdate: October 6 2022 $
.Dt LDOM.CONF 5 sparc64
.Os
.Sh NAME
can be specified with a human-readable scale, using the format described in
.Xr scan_scaled 3 ,
e.g. 512M.
-.It Ic iodevice Ar path
+.It Ic iodevice Ar device
Assign the specified PCIe device to the guest domain.
+.Ar device
+may be either a device path
+.Pq Pa /@400/@2/@0/@8
+or a pseudonym
+.Pq Pa /SYS/MB/PCIE0 .
This keyword can be used multiple times.
.It Ic variable Ar name Ns = Ns Ar value
Set the specified NVRAM variable for the domain.
-/* $OpenBSD: parse.y,v 1.24 2021/10/15 15:01:28 naddy Exp $ */
+/* $OpenBSD: parse.y,v 1.25 2022/10/06 21:35:52 kn Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org>
struct iodev *iodev;
SIMPLEQ_FOREACH(odomain, &conf->domain_list, entry)
SIMPLEQ_FOREACH(iodev, &odomain->iodev_list, entry)
- if (strcmp(iodev->path, $2) == 0) {
+ if (strcmp(iodev->dev, $2) == 0) {
yyerror("iodevice %s already"
" assigned", $2);
YYERROR;
}
iodev = xmalloc(sizeof(struct iodev));
- iodev->path = $2;
+ iodev->dev = $2;
SIMPLEQ_INSERT_TAIL(&domain->iodev_list, iodev, entry);
}
;