Also, error case might happen before proc_vmspace_getref() (hi <ad>!).
Thanks CID 4551 and 4552. This is serious, pullup will be requested.
OK by <wrstuden>.
This removes a hard limit that would prevent a guest from running with more
than 7 virtual network interface.
If running on a hypervisor that doesn't support GNTTABOP_query_size, fall back
to a 4-pages grant table, so this change is backward-compatible.
(at least three or four persons were against it).
- Add a new sensor type: ENVSYS_BATTERY_STATE, this uses value_cur
and some predefined values in a static table, like ENVSYS_DRIVE.
- Move all static tables to sysmon_envsys_tables.c and use a function
on it to retrieve a pointer to the struct of the specified type.
- Rename the ENVSYS_FMONDRVSTCHANGED to ENVSYS_FMONSTCHANGED and make
it generic for Battery state and drive sensors (this flag enables
monitoring on these sensors when state has been changed).
- Update sysmon_penvsys_event() to report state changes on
ENVSYS_BATTERY_STATE sensors and remove other type of events, with
PENVSYS_EVENT_STATE_CHANGED they are not necessary anymore.
and data (PIO Format 0 selects the speed of the slowest drive).
- Set correctly Ultra DMA and Multi-word DMA modes.
- Update comments to be more correct after reading again the datasheet.
the current battery charge state.
$ envstat -dacpibat0 -s"acpibat0 charge state"
acpibat0 charge state: NORMAL
$
It will show WARNING, CRITICAL, LOW or NORMAL depending on the
state it is.
ENVSYS_GSTRING (aka Generic String) uses the genstr member in
the envsys_data_t struct to add a generic string that envstat(8)
will show as value or state.
It's like the ENVSYS_DRIVER, but doesn't use value_cur. Below
is the dictionary created on these sensors:
<dict>
<key>description</key>
<string>acpibat0 charge state</string>
<key>generic-state-string</key>
<string>NORMAL</string>
<key>monitoring-supported</key>
<false/>
<key>state</key>
<string>valid</string>
<key>type</key>
<string>Generic string</string>
</dict>
Note that it's limited to 32 chars, but we can grow it if needed.
envstat(8) will print ENVSYS_GSTRING sensors as:
$ envstat -dacpibat0 -s"acpibat0 charge state"
acpibat0 charge state: NORMAL
$