110b59a9bSPeter Grehan.\" Copyright (c) 2011 Bryan Venteicher 210b59a9bSPeter Grehan.\" All rights reserved. 310b59a9bSPeter Grehan.\" 410b59a9bSPeter Grehan.\" Redistribution and use in source and binary forms, with or without 510b59a9bSPeter Grehan.\" modification, are permitted provided that the following conditions 610b59a9bSPeter Grehan.\" are met: 710b59a9bSPeter Grehan.\" 1. Redistributions of source code must retain the above copyright 810b59a9bSPeter Grehan.\" notice, this list of conditions and the following disclaimer. 910b59a9bSPeter Grehan.\" 2. Redistributions in binary form must reproduce the above copyright 1010b59a9bSPeter Grehan.\" notice, this list of conditions and the following disclaimer in the 1110b59a9bSPeter Grehan.\" documentation and/or other materials provided with the distribution. 1210b59a9bSPeter Grehan.\" 1310b59a9bSPeter Grehan.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1410b59a9bSPeter Grehan.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1510b59a9bSPeter Grehan.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1610b59a9bSPeter Grehan.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1710b59a9bSPeter Grehan.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1810b59a9bSPeter Grehan.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1910b59a9bSPeter Grehan.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2010b59a9bSPeter Grehan.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2110b59a9bSPeter Grehan.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2210b59a9bSPeter Grehan.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2310b59a9bSPeter Grehan.\" SUCH DAMAGE. 2410b59a9bSPeter Grehan.\" 25118619acSBryan Venteicher.Dd July 2, 2013 2610b59a9bSPeter Grehan.Dt VIRTIO_BLK 4 2710b59a9bSPeter Grehan.Os 2810b59a9bSPeter Grehan.Sh NAME 2910b59a9bSPeter Grehan.Nm virtio_blk 3010b59a9bSPeter Grehan.Nd VirtIO Block driver 3110b59a9bSPeter Grehan.Sh SYNOPSIS 3210b59a9bSPeter GrehanTo compile this driver into the kernel, 3310b59a9bSPeter Grehanplace the following lines in your 3410b59a9bSPeter Grehankernel configuration file: 3510b59a9bSPeter Grehan.Bd -ragged -offset indent 3610b59a9bSPeter Grehan.Cd "device virtio_blk" 3710b59a9bSPeter Grehan.Ed 3810b59a9bSPeter Grehan.Pp 3910b59a9bSPeter GrehanAlternatively, to load the driver as a 4010b59a9bSPeter Grehanmodule at boot time, place the following line in 4110b59a9bSPeter Grehan.Xr loader.conf 5 : 4210b59a9bSPeter Grehan.Bd -literal -offset indent 4310b59a9bSPeter Grehanvirtio_blk_load="YES" 4410b59a9bSPeter Grehan.Ed 4510b59a9bSPeter Grehan.Sh DESCRIPTION 4610b59a9bSPeter GrehanThe 4710b59a9bSPeter Grehan.Nm 4810b59a9bSPeter Grehandevice driver provides support for VirtIO block devices. 4910b59a9bSPeter Grehan.Sh LOADER TUNABLES 5010b59a9bSPeter GrehanTunables can be set at the 5110b59a9bSPeter Grehan.Xr loader 8 5210b59a9bSPeter Grehanprompt before booting the kernel or stored in 5310b59a9bSPeter Grehan.Xr loader.conf 5 . 54118619acSBryan Venteicher.Bl -tag -width indent 5510b59a9bSPeter Grehan.It Va hw.vtblk.no_ident 56118619acSBryan Venteicher.It Va hw.vtblk. Ns Ar X Ns Va .no_ident 57118619acSBryan Venteicher.Pp 58118619acSBryan VenteicherThese tunables disable retrieving the device identification string 59118619acSBryan Venteicherfrom the hypervisor either globally or per-device. 6028083eaaSChristian BruefferThe default value is 0. 61118619acSBryan Venteicher.It Va hw.vtblk.writecache_mode 62118619acSBryan Venteicher.It Va hw.vtblk. Ns Ar X Ns Va .writecache_mode 63118619acSBryan Venteicher.Pp 64118619acSBryan VenteicherThese tunables determine the write cache mode globally or per-device. 65118619acSBryan VenteicherThe mode can changed only if the ConfigWCE feature is negotiated. 66118619acSBryan VenteicherSet to 0 for writethrough mode, 1 for writeback mode, and -1 to leave 67118619acSBryan Venteicherit as-is. 68118619acSBryan VenteicherThe default value is to leave as-is. 69118619acSBryan Venteicher.El 70118619acSBryan Venteicher.Sh SYSCTL VARIABLES 71118619acSBryan VenteicherThe following variables are available as 72118619acSBryan Venteicher.Xr sysctl 8 73118619acSBryan Venteichervariables. 74118619acSBryan Venteicher.Bl -tag -width indent 75118619acSBryan Venteicher.It Va dev.vtblk. Ns Ar X Ns Va .writecache_mode 76118619acSBryan Venteicher.Pp 77118619acSBryan VenteicherThe write cache mode of the device can be either writethrough (0) or 78118619acSBryan Venteicherwriteback (1). 79118619acSBryan VenteicherIf the ConfigWCE feature is negotiated, the write cache mode can 80118619acSBryan Venteicherbe toggled between writethrough and writeback. 8110b59a9bSPeter Grehan.El 8210b59a9bSPeter Grehan.Sh SEE ALSO 8310b59a9bSPeter Grehan.Xr virtio 4 8410b59a9bSPeter Grehan.Sh HISTORY 8510b59a9bSPeter GrehanThe 8610b59a9bSPeter Grehan.Nm 8710b59a9bSPeter Grehandriver was written by 88*6c899950SBaptiste Daroussin.An Bryan Venteicher Aq Mt bryanv@FreeBSD.org . 8910b59a9bSPeter GrehanIt first appeared in 9010b59a9bSPeter Grehan.Fx 9.0 . 91