xref: /freebsd/share/man/man4/virtio_blk.4 (revision 6c89995002b9c6d1a9c7365483c55c106fc752d5)
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.\"
2510b59a9bSPeter Grehan.\" $FreeBSD$
2610b59a9bSPeter Grehan.\"
27118619acSBryan Venteicher.Dd July 2, 2013
2810b59a9bSPeter Grehan.Dt VIRTIO_BLK 4
2910b59a9bSPeter Grehan.Os
3010b59a9bSPeter Grehan.Sh NAME
3110b59a9bSPeter Grehan.Nm virtio_blk
3210b59a9bSPeter Grehan.Nd VirtIO Block driver
3310b59a9bSPeter Grehan.Sh SYNOPSIS
3410b59a9bSPeter GrehanTo compile this driver into the kernel,
3510b59a9bSPeter Grehanplace the following lines in your
3610b59a9bSPeter Grehankernel configuration file:
3710b59a9bSPeter Grehan.Bd -ragged -offset indent
3810b59a9bSPeter Grehan.Cd "device virtio_blk"
3910b59a9bSPeter Grehan.Ed
4010b59a9bSPeter Grehan.Pp
4110b59a9bSPeter GrehanAlternatively, to load the driver as a
4210b59a9bSPeter Grehanmodule at boot time, place the following line in
4310b59a9bSPeter Grehan.Xr loader.conf 5 :
4410b59a9bSPeter Grehan.Bd -literal -offset indent
4510b59a9bSPeter Grehanvirtio_blk_load="YES"
4610b59a9bSPeter Grehan.Ed
4710b59a9bSPeter Grehan.Sh DESCRIPTION
4810b59a9bSPeter GrehanThe
4910b59a9bSPeter Grehan.Nm
5010b59a9bSPeter Grehandevice driver provides support for VirtIO block devices.
5110b59a9bSPeter Grehan.Sh LOADER TUNABLES
5210b59a9bSPeter GrehanTunables can be set at the
5310b59a9bSPeter Grehan.Xr loader 8
5410b59a9bSPeter Grehanprompt before booting the kernel or stored in
5510b59a9bSPeter Grehan.Xr loader.conf 5 .
56118619acSBryan Venteicher.Bl -tag -width indent
5710b59a9bSPeter Grehan.It Va hw.vtblk.no_ident
58118619acSBryan Venteicher.It Va hw.vtblk. Ns Ar X Ns Va .no_ident
59118619acSBryan Venteicher.Pp
60118619acSBryan VenteicherThese tunables disable retrieving the device identification string
61118619acSBryan Venteicherfrom the hypervisor either globally or per-device.
6228083eaaSChristian BruefferThe default value is 0.
63118619acSBryan Venteicher.It Va hw.vtblk.writecache_mode
64118619acSBryan Venteicher.It Va hw.vtblk. Ns Ar X Ns Va .writecache_mode
65118619acSBryan Venteicher.Pp
66118619acSBryan VenteicherThese tunables determine the write cache mode globally or per-device.
67118619acSBryan VenteicherThe mode can changed only if the ConfigWCE feature is negotiated.
68118619acSBryan VenteicherSet to 0 for writethrough mode, 1 for writeback mode, and -1 to leave
69118619acSBryan Venteicherit as-is.
70118619acSBryan VenteicherThe default value is to leave as-is.
71118619acSBryan Venteicher.El
72118619acSBryan Venteicher.Sh SYSCTL VARIABLES
73118619acSBryan VenteicherThe following variables are available as
74118619acSBryan Venteicher.Xr sysctl 8
75118619acSBryan Venteichervariables.
76118619acSBryan Venteicher.Bl -tag -width indent
77118619acSBryan Venteicher.It Va dev.vtblk. Ns Ar X Ns Va .writecache_mode
78118619acSBryan Venteicher.Pp
79118619acSBryan VenteicherThe write cache mode of the device can be either writethrough (0) or
80118619acSBryan Venteicherwriteback (1).
81118619acSBryan VenteicherIf the ConfigWCE feature is negotiated, the write cache mode can
82118619acSBryan Venteicherbe toggled between writethrough and writeback.
8310b59a9bSPeter Grehan.El
8410b59a9bSPeter Grehan.Sh SEE ALSO
8510b59a9bSPeter Grehan.Xr virtio 4
8610b59a9bSPeter Grehan.Sh HISTORY
8710b59a9bSPeter GrehanThe
8810b59a9bSPeter Grehan.Nm
8910b59a9bSPeter Grehandriver was written by
90*6c899950SBaptiste Daroussin.An Bryan Venteicher Aq Mt bryanv@FreeBSD.org .
9110b59a9bSPeter GrehanIt first appeared in
9210b59a9bSPeter Grehan.Fx 9.0 .
93