|
31 | 31 | #include "smart.h"
|
32 | 32 | #include "smart-private.h"
|
33 | 33 |
|
34 |
| -/** |
35 |
| - * SECTION: smart |
36 |
| - * @short_description: S.M.A.R.T. device reporting and management. |
37 |
| - * @title: SMART plugin |
38 |
| - * @include: smart.h |
39 |
| - * |
40 |
| - * Plugin for ATA and SCSI/SAS S.M.A.R.T. device reporting and management. For NVMe |
41 |
| - * health reporting please use the native [`nvme`][libblockdev-NVMe] plugin. |
42 |
| - * |
43 |
| - * This libblockdev plugin strives to provide good enough abstraction on top of vastly |
44 |
| - * different backend implementations. Two plugin implementations are available: |
45 |
| - * `libatasmart` (default) and `smartmontools` (experimental). |
46 |
| - * |
47 |
| - * Not all plugin implementations provide full functionality and it is advised |
48 |
| - * to use standard libblockdev tech query functions for feature availability testing. |
49 |
| - * For example, the `libatasmart` plugin only provides ATA functionality and error |
50 |
| - * is returned when any SCSI function is called. |
51 |
| - * |
52 |
| - * ## libatasmart plugin # |
53 |
| - * |
54 |
| - * An implementation proven for over a decade, being essentially a port of UDisks code. |
55 |
| - * The `libatasmart` library is reasonably lightweight with minimal dependencies, |
56 |
| - * light on I/O and consuming C API directly with clearly defined data types. |
57 |
| - * However essentially no quirks or any drive database is present in the library |
58 |
| - * (apart from a couple of very old laptop drives). |
59 |
| - * |
60 |
| - * ## smartmontools plugin # |
61 |
| - * |
62 |
| - * In contrast to libatasmart, the smartmontools project is a feature-rich |
63 |
| - * implementation supporting specialties like vendor-specific data blocks. It is |
64 |
| - * a considerably heavier implementation I/O-wise due to device type detection and |
65 |
| - * retrieval of more data blocks from the drive. |
66 |
| - * |
67 |
| - * There's no C API at the moment and the plugin resorts to executing the `smartctl` |
68 |
| - * command and parsing its JSON output, that is by nature loosely-defined. This |
69 |
| - * presents challenges in data type conversions, interpretation of printed values |
70 |
| - * and volatile JSON key presence. Besides, executing external commands always brings |
71 |
| - * certain performance overhead and caution is advised when retrieving SMART data |
72 |
| - * from multiple drives in parallel. |
73 |
| - * |
74 |
| - * ## Atribute naming and value interpretation # |
75 |
| - * |
76 |
| - * Check #BDSmartATAAttribute for the struct members overview first. The plugin |
77 |
| - * public API provides both the implementation-specific attribute names/values |
78 |
| - * as well as unified ('well-known', translated) interpretation that is preferred |
79 |
| - * for general use. |
80 |
| - * |
81 |
| - * The `well_known_name` property follows the libatasmart-style naming - |
82 |
| - * e.g. `'power-on-hours'`. Unknown or untrusted attributes are either provided |
83 |
| - * in the form of `'attribute-123'` or by %NULL. |
84 |
| - * |
85 |
| - * Similarly, value of an attribute is provided in variety of interpretations, |
86 |
| - * subject to availability: |
87 |
| - * - the `value`, `worst` and `threshold` are normalized values in typical S.M.A.R.T. fashion |
88 |
| - * - the `value_raw` as a 64-bit untranslated value with no further context |
89 |
| - * of which bits are actually valid for a particular attribute |
90 |
| - * - the `pretty_value_string` as an implementation-specific string representation, |
91 |
| - * intended for end-user display |
92 |
| - * - the `pretty_value` and `pretty_value_unit` as a libatasmart-style of unified value/type pair |
93 |
| - * |
94 |
| - * Both libblockdev plugins strive for best effort of providing accurate values, |
95 |
| - * however there are often challenges ranging from string-to-number conversion, |
96 |
| - * multiple values being unpacked from a single raw number or not having enough |
97 |
| - * context provided by the underlying library for a trusted value interpretation. |
98 |
| - * |
99 |
| - * ## Attribute validation # |
100 |
| - * |
101 |
| - * It may seem obvious to use numerical attribute ID as an authoritative attribute |
102 |
| - * identifier, however in reality drive vendors tend not to stick with public |
103 |
| - * specifications. Attributes are often reused for vendor-specific values and this |
104 |
| - * differs from model to model even for a single vendor. This is more often the case |
105 |
| - * with SSD drives than traditional HDDs. |
106 |
| - * |
107 |
| - * Historically it brought confusion and false alarms on user's end and eventually |
108 |
| - * led to some form of quirk database in most projects. Maintaining such database |
109 |
| - * is a lifetime task and the only successful effort is the smartmontools' `drivedb.h` |
110 |
| - * collection. Quirks are needed for about everything - meaning of a particular |
111 |
| - * attribute (i.e. a 'well-known' name), interpretation of a raw value, all this |
112 |
| - * filtered by drive model string and firmware revision. |
113 |
| - * |
114 |
| - * However even there not everything is consistent and slight variations in |
115 |
| - * a 'well-known' name can be found. Besides, the attribute naming syntax differs |
116 |
| - * from our chosen libatasmart-style form. |
117 |
| - * |
118 |
| - * For this reason an internal libblockdev translation table has been introduced |
119 |
| - * to ensure a bit of consistency. The translation table is kept conservative, |
120 |
| - * is by no means complete and may get extended in future libblockdev releases. |
121 |
| - * As a result, some attributes may be reported as 'untrusted' or 'unknown'. |
122 |
| - * |
123 |
| - * The translation table at this point doesn't handle 'moves' where a different |
124 |
| - * attribute ID has been assigned for otherwise well defined attribute. |
125 |
| - * |
126 |
| - * An experimental `drivedb.h` parser is provided for the libatasmart plugin |
127 |
| - * as an additional tier of validation based on actual drive model + firmware match. |
128 |
| - * Being a C header file, the `drivedb.h` definitions are compiled in the plugin. |
129 |
| - * There's no support for loading external `drivedb.h` file though. This however |
130 |
| - * only serves for validation. Providing backwards mapping to libatasmart-style |
131 |
| - * of attributes is considered as a TODO. |
132 |
| - * |
133 |
| - * ## Device type detection, multipath # |
134 |
| - * |
135 |
| - * There's a big difference in how a drive is accessed. While libatasmart performs |
136 |
| - * essentially no device type detection and sends a I/O request right away |
137 |
| - * (with usual error handling), `smartctl` implements a logic to determine which |
138 |
| - * protocol to use, supporting various passthrough mechanisms and interface bridges. |
139 |
| - * Such detection is not always reliable though, having known issues with `dm-multipath` |
140 |
| - * for example. For this case most plugin functions provide the `'extra'` argument |
141 |
| - * allowing consumers to provide specific arguments such as `'--device=' for device |
142 |
| - * type override`. This is only supported by the smartmontools plugin and ignored |
143 |
| - * by the libatasmart plugin. |
144 |
| - * |
145 |
| - */ |
146 |
| - |
147 | 34 | /**
|
148 | 35 | * bd_smart_is_tech_avail:
|
149 | 36 | * @tech: the queried tech
|
@@ -615,7 +502,7 @@ gboolean bd_smart_set_enabled (G_GNUC_UNUSED const gchar *device, G_GNUC_UNUSED
|
615 | 502 | *
|
616 | 503 | * Executes or aborts device self-test.
|
617 | 504 | *
|
618 |
| - * Returns: %TRUE when the self-test was trigerred successfully or %FALSE in case of an error (with @error set). |
| 505 | + * Returns: %TRUE when the self-test was triggered successfully or %FALSE in case of an error (with @error set). |
619 | 506 | *
|
620 | 507 | * Tech category: %BD_SMART_TECH_ATA-%BD_SMART_TECH_MODE_SELFTEST
|
621 | 508 | */
|
|
0 commit comments