diff options
author | zhenwei pi <pizhenwei@bytedance.com> | 2022-04-20 10:26:10 +0800 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-04 13:03:19 +0400 |
commit | 22668881f3def13e9ffcf16840e5fde974a55b1e (patch) | |
tree | fa48d3da9af891089afdae9a0568c208f4a063ca /qga/qapi-schema.json | |
parent | d48f61c8ea838ec8c232c54f043c855359774a7a (diff) |
qga: Introduce disk smart
After assigning a NVMe/SCSI controller to guest by VFIO, we lose
everything on the host side. A guest uses these devices exclusively,
we usually don't care the actions on these devices. But there is a
low probability that hitting physical hardware warning, we need a
chance to get the basic smart log info.
Introduce disk smart, and implement NVMe smart on linux.
Thanks to Keith and Marc-André.
CC: Keith Busch <kbusch@kernel.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20220420022610.418052-3-pizhenwei@bytedance.com>
Diffstat (limited to 'qga/qapi-schema.json')
-rw-r--r-- | qga/qapi-schema.json | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 5ea76cfd1d..4d8e506c9e 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -889,6 +889,55 @@ '*ccw-address': 'GuestCCWAddress'} } ## +# @GuestNVMeSmart: +# +# NVMe smart informations, based on NVMe specification, +# section <SMART / Health Information (Log Identifier 02h)> +# +# Since: 7.1 +## +{ 'struct': 'GuestNVMeSmart', + 'data': {'critical-warning': 'int', + 'temperature': 'int', + 'available-spare': 'int', + 'available-spare-threshold': 'int', + 'percentage-used': 'int', + 'data-units-read-lo': 'uint64', + 'data-units-read-hi': 'uint64', + 'data-units-written-lo': 'uint64', + 'data-units-written-hi': 'uint64', + 'host-read-commands-lo': 'uint64', + 'host-read-commands-hi': 'uint64', + 'host-write-commands-lo': 'uint64', + 'host-write-commands-hi': 'uint64', + 'controller-busy-time-lo': 'uint64', + 'controller-busy-time-hi': 'uint64', + 'power-cycles-lo': 'uint64', + 'power-cycles-hi': 'uint64', + 'power-on-hours-lo': 'uint64', + 'power-on-hours-hi': 'uint64', + 'unsafe-shutdowns-lo': 'uint64', + 'unsafe-shutdowns-hi': 'uint64', + 'media-errors-lo': 'uint64', + 'media-errors-hi': 'uint64', + 'number-of-error-log-entries-lo': 'uint64', + 'number-of-error-log-entries-hi': 'uint64' } } + +## +# @GuestDiskSmart: +# +# Disk type related smart information. +# +# - @nvme: NVMe disk smart +# +# Since: 7.1 +## +{ 'union': 'GuestDiskSmart', + 'base': { 'type': 'GuestDiskBusType' }, + 'discriminator': 'type', + 'data': { 'nvme': 'GuestNVMeSmart' } } + +## # @GuestDiskInfo: # # @name: device node (Linux) or device UNC (Windows) @@ -899,12 +948,14 @@ # @address: disk address information (only for non-virtual devices) # @alias: optional alias assigned to the disk, on Linux this is a name assigned # by device mapper +# @smart: disk smart information (Since 7.1) # # Since 5.2 ## { 'struct': 'GuestDiskInfo', 'data': {'name': 'str', 'partition': 'bool', '*dependencies': ['str'], - '*address': 'GuestDiskAddress', '*alias': 'str'} } + '*address': 'GuestDiskAddress', '*alias': 'str', + '*smart': 'GuestDiskSmart'} } ## # @guest-get-disks: |