pvbus.4 revision 1.9
$OpenBSD: pvbus.4,v 1.9 2016/09/20 09:42:12 jmc Exp $

Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
Copyright (c) 2006 Jason McIntyre <jmc@openbsd.org>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

.Dd $Mdocdate: September 15 2016 $ .Dt PVBUS 4 .Os .Sh NAME .Nm pvbus .Nd paravirtual device tree root .Sh SYNOPSIS .Cd "pvbus0 at mainbus0"

p n sys/types.h n sys/ioctl.h n dev/pv/pvvar.h .Sh DESCRIPTION .Nm is used on virtual machines that are running on hypervisors. It provides a pseudo-bus for all paravirtual devices that do not attach to a well-known bus like .Xr pci 4 . The .Nm driver is responsible for detecting the hypervisor interface, checking the capabilities, attaching the paravirtual devices, and providing access to supported information stores. .Ss Supported hypervisors l -tag -width 13n -offset ind -compact t KVM Kernel-based Virtual Machine t Hyper-V Microsoft Hyper-V t OpenBSD .Ox .Xr vmm 4 t VMware VMware vSphere Hypervisor and ESXi t Xen Xen VMM .El

p Note that a hypervisor can attempt to emulate other hypervisors, so multiple hypervisor interfaces may be available on the same host. .Ss VMware paravirtual devices l -tag -width 13n -offset ind -compact t Xr vmt 4 VMware Tools driver and .Dq guestinfo information store .El .Ss Hyper-V paravirtual devices l -tag -width 13n -offset ind -compact t Xr hvn 4 Hyper-V virtual networking interface t Xr hyperv 4 Hyper-V guest nexus device .El .Ss Xen paravirtual devices l -tag -width 13n -offset ind -compact t Xr xen 4 Xen domU nexus device and XenStore information store t Xr xnf 4 Xen Netfront virtual networking interface .El .Sh IOCTL INTERFACE .Nm supports .Xr ioctl 2 commands to exchange information with the hypervisor interface, as implemented in the .Xr hostctl 8 program. Each detected hypervisor interface is available as a character special device file,

a /dev/pvbus0 ,

a /dev/pvbus1 , etc. All available commands use the same .Fa pvbus_req structure: d -literal struct pvbus_req { size_t pvr_keylen; char *pvr_key; size_t pvr_valuelen; char *pvr_value; }; .Ed

p The caller is responsible for attaching character buffers to the .Fa pvr_key and .Fa pvr_value fields and to set their length in .Fa pvr_keylen and .Fa pvr_valuelen accordingly. All keys and values are nul-terminated strings.

p The following .Xr ioctl 2 commands are available: l -tag -width PVBUSIOC_KVWRITE t Dv PVBUSIOC_KVREAD Read the value from .Fa pvr_key and return it in .Fa pvr_value . t Dv PVBUSIOC_KVTYPE Return the type of the attached hypervisor interface as a string in .Fa pvr_key ; see .Sx Supported Hypervisors . t Dv PVBUSIOC_KVWRITE Write the new value .Fa pvr_value to the key .Fa pvr_key . This command requires write permissions on the device file. .El .Sh FILES l -tag -width "/dev/pvbusX" -compact t /dev/pvbus Ns Ar u .Nm device unit .Ar u file. .El .Sh SEE ALSO .Xr autoconf 4 , .Xr intro 4 , .Xr mainbus 4 , .Xr vmm 4 , .Xr hostctl 8 .Sh HISTORY The .Nm pseudo-bus first appeared in .Ox 5.8 . .Sh AUTHORS The .Nm pseudo-bus was written by .An Reyk Floeter Aq Mt reyk@openbsd.org .