On 06/01/2018 10:27 AM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanx...@gmail.com>
This patch adds support for getting the usage of mounted
filesystem.
The usage of fs stored as used_bytes and total_bytes.
It's very useful when we try to monitor guest's filesystem.
Cc: Michael Roth <mdr...@linux.vnet.ibm.com>
Cc: Eric Blake <ebl...@redhat.com>
Cc: Daniel P. Berrangé <berra...@redhat.com>
Signed-off-by: Chen Hanxiao <chenhanx...@gmail.com>
+++ b/qga/qapi-schema.json
@@ -840,12 +840,24 @@
'bus-type': 'GuestDiskBusType',
'bus': 'int', 'target': 'int', 'unit': 'int'} }
+##
+# @GuestFsUsage:
+#
+# @used-bytes: file system used bytes
+# @total-bytes: file system total bytes for nonroot user
+#
+# Since: 3.0
+##
+{ 'struct': 'GuestFsUsage',
+ 'data': {'used-bytes': 'uint64', 'total-bytes': 'uint64'} }
That seems like pointless nesting on the wire, unless we have plans of
reusing this type in other API calls. Is it any easier...
+
##
# @GuestFilesystemInfo:
#
# @name: disk name
# @mountpoint: mount point path
# @type: file system type string
+# @usage: file system usage struct (since 3.0)
# @disk: an array of disk hardware information that the volume lies on,
# which may be empty if the disk type is not supported
#
@@ -853,7 +865,7 @@
##
{ 'struct': 'GuestFilesystemInfo',
'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str',
- 'disk': ['GuestDiskAddress']} }
+ '*usage': 'GuestFsUsage', 'disk': ['GuestDiskAddress']} }
...to just inline '*used-bytes' and '*total-bytes' here?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org