diff options
author | ken <ken@FreeBSD.org> | 2017-05-08 17:55:51 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 2017-05-08 17:55:51 +0000 |
commit | 465c56ff57540e744cc77e5c3c596fe6c1d5fcb6 (patch) | |
tree | c2478132dc7f57d18d76e2164891e5fe625fdf33 /usr.bin | |
parent | b7ae3fc60a7a94bcccb25491be91b45e3fbfb0cc (diff) | |
download | FreeBSD-src-465c56ff57540e744cc77e5c3c596fe6c1d5fcb6.zip FreeBSD-src-465c56ff57540e744cc77e5c3c596fe6c1d5fcb6.tar.gz |
MFC r317848:
Add basic programmable early warning error injection to the sa(4) driver.
This will help application developers simulate end of tape conditions.
To inject an error in sa0:
sysctl kern.cam.sa.0.inject_eom=1
This will return the next read or write request queued with 0 bytes
written. Any subsequent writes or reads will go along as usual.
This will also cause the early warning position flag to get set
for the next position query. So, 'mt status' will show the BPEW
(Beyond Programmable Early Warning) flag on the first query after
an error injection. After that, the position flags will be as they
are in the underlying tape drive.
Also, update the sa(4) man page to describe tape parameters,
which can be set via 'mt param'.
sys/cam/scsi/scsi_sa.c:
In saregister(), create the inject_eom sysctl variable.
In sastart(), check to see whether inject_eom is set. If
so, return the read or write with 0 bytes written to
indicate EOM. Set the set_pews_status flag so that we
fake PEWS status in the next position call for reads, and the
next 3 calls for writes. This allows the user to see the BPEW
flag one time via 'mt status'.
In sagetpos(), check the set_pews_status flag and fake
PEWS status and decrement the counter if it is set.
share/man/man4/sa.4:
Document the inject_eom sysctl variable.
Document all of the parameters currently supported via
'mt param'.
usr.bin/mt/mt.1:
Point the user to the sa(4) man page for more details on
supported parameters.
Sponsored by: Spectra Logic
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mt/mt.1 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/mt/mt.1 b/usr.bin/mt/mt.1 index 7af3d2b..ab5930c 100644 --- a/usr.bin/mt/mt.1 +++ b/usr.bin/mt/mt.1 @@ -29,7 +29,7 @@ .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 20, 2016 +.Dd May 5, 2017 .Dt MT 1 .Os .Sh NAME @@ -284,6 +284,9 @@ One of or .Fl x must be specified to indicate which operation to perform. +See +.Xr sa 4 +for more detailed information on the parameters. .Bl -tag -width 8n .It Fl l List parameters, values and descriptions. |