Skip to content

Commit b893c4b

Browse files
authored
Merge pull request #1063 from tbzatek/smart-4
smart: Clarify use of ID_ATA_SMART_ACCESS udev property
2 parents bfe1b71 + e02104a commit b893c4b

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

src/plugins/smart/smart-common.c

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,30 @@
130130
*
131131
* ## Device type detection, multipath #
132132
*
133-
* There's a big difference in how a drive is accessed. While libatasmart performs
134-
* essentially no device type detection and sends a I/O request right away
135-
* (with usual error handling), `smartctl` implements a logic to determine which
136-
* protocol to use, supporting various passthrough mechanisms and interface bridges.
137-
* Such detection is not always reliable though, having known issues with `dm-multipath`
138-
* for example. For this case most plugin functions provide the `'extra'` argument
139-
* allowing consumers to provide specific arguments such as `'--device=' for device
140-
* type override`. This is only supported by the smartmontools plugin and ignored
141-
* by the libatasmart plugin.
142-
*
133+
* There's a big difference in how a drive is accessed. While `libatasmart` performs
134+
* only very basic device type detection based on parent subsystem as retrieved from
135+
* the udev database, `smartctl` implements logic to determine which protocol to use,
136+
* supporting variety of passthrough mechanisms and interface bridges. Such detection
137+
* is not always reliable though, having known issues with `dm-multipath` for example.
138+
*
139+
* For this case most plugin functions consume the `extra` argument allowing
140+
* callers to specify arguments such as `--device=` for device type override. This
141+
* is only supported by the smartmontools plugin and ignored by the libatasmart
142+
* plugin.
143+
*
144+
* As a well kept secret libatasmart has historically supported device type override
145+
* via the `ID_ATA_SMART_ACCESS` udev property. There's no public C API for this and
146+
* libblockdev generally tends to avoid any udev interaction, leaving the burden
147+
* to callers.
148+
*
149+
* Valid values for this property include `auto`, `linux-ide`, `sat16`, `sat12`,
150+
* `sunplus`, `jmicron`.
151+
*
152+
* A common example to override QEMU ATA device type, which often requires legacy
153+
* IDE protocol:
154+
* |[
155+
* KERNEL=="sd*", ENV{ID_VENDOR}=="ATA", ENV{ID_MODEL}=="QEMU_HARDDISK", ENV{ID_ATA}=="1", ENV{ID_ATA_SMART_ACCESS}="linux-ide"
156+
* ]|
143157
*/
144158

145159
/**

0 commit comments

Comments
 (0)