diff options
author | Tomoki Sekiyama <tomoki.sekiyama@hds.com> | 2014-06-30 17:51:34 -0400 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2014-08-07 17:15:14 -0500 |
commit | 46d4c5723e438be0fa564b8adeefed8f40f4a6ca (patch) | |
tree | ebdbb81122815e607f580784106461c5367c7ed4 /qga/qapi-schema.json | |
parent | e99bce2021d2fd41a4d02f5e7e83734b03ff2b6f (diff) |
qga: Add guest-get-fsinfo command
Add command to get mounted filesystems information in the guest.
The returned value contains a list of mountpoint paths and
corresponding disks info such as disk bus type, drive address,
and the disk controllers' PCI addresses, so that management layer
such as libvirt can resolve the disk backends.
For example, when `lsblk' result is:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 1G 0 disk
`-sdb1 8:17 0 1024M 0 part
`-vg0-lv0 253:1 0 1.4G 0 lvm /mnt/test
sdc 8:32 0 1G 0 disk
`-sdc1 8:33 0 512M 0 part
`-vg0-lv0 253:1 0 1.4G 0 lvm /mnt/test
vda 252:0 0 25G 0 disk
`-vda1 252:1 0 25G 0 part /
where sdb is a SCSI disk with PCI controller 0000:00:0a.0 and ID=1,
sdc is an IDE disk with PCI controller 0000:00:01.1, and
vda is a virtio-blk disk with PCI device 0000:00:06.0,
guest-get-fsinfo command will return the following result:
{"return":
[{"name":"dm-1",
"mountpoint":"/mnt/test",
"disk":[
{"bus-type":"scsi","bus":0,"unit":1,"target":0,
"pci-controller":{"bus":0,"slot":10,"domain":0,"function":0}},
{"bus-type":"ide","bus":0,"unit":0,"target":0,
"pci-controller":{"bus":0,"slot":1,"domain":0,"function":1}}],
"type":"xfs"},
{"name":"vda1", "mountpoint":"/",
"disk":[
{"bus-type":"virtio","bus":0,"unit":0,"target":0,
"pci-controller":{"bus":0,"slot":6,"domain":0,"function":0}}],
"type":"ext4"}]}
In Linux guest, the disk information is resolved from sysfs. So far,
it only supports virtio-blk, virtio-scsi, IDE, SATA, SCSI disks on x86
hosts, and "disk" parameter may be empty for unsupported disk types.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
*updated schema to report 2.2 as initial supported version
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/qapi-schema.json')
-rw-r--r-- | qga/qapi-schema.json | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 14b2aec69f..376e79f583 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -659,3 +659,82 @@ { 'command': 'guest-set-vcpus', 'data': {'vcpus': ['GuestLogicalProcessor'] }, 'returns': 'int' } + +## +# @GuestDiskBusType +# +# An enumeration of bus type of disks +# +# @ide: IDE disks +# @fdc: floppy disks +# @scsi: SCSI disks +# @virtio: virtio disks +# @xen: Xen disks +# @usb: USB disks +# @uml: UML disks +# @sata: SATA disks +# @sd: SD cards +# +# Since: 2.2 +## +{ 'enum': 'GuestDiskBusType', + 'data': [ 'ide', 'fdc', 'scsi', 'virtio', 'xen', 'usb', 'uml', 'sata', + 'sd' ] } + +## +# @GuestPCIAddress: +# +# @domain: domain id +# @bus: bus id +# @slot: slot id +# @function: function id +# +# Since: 2.2 +## +{ 'type': 'GuestPCIAddress', + 'data': {'domain': 'int', 'bus': 'int', + 'slot': 'int', 'function': 'int'} } + +## +# @GuestDiskAddress: +# +# @pci-controller: controller's PCI address +# @type: bus type +# @bus: bus id +# @target: target id +# @unit: unit id +# +# Since: 2.2 +## +{ 'type': 'GuestDiskAddress', + 'data': {'pci-controller': 'GuestPCIAddress', + 'bus-type': 'GuestDiskBusType', + 'bus': 'int', 'target': 'int', 'unit': 'int'} } + +## +# @GuestFilesystemInfo +# +# @name: disk name +# @mountpoint: mount point path +# @type: file system type string +# @disk: an array of disk hardware information that the volume lies on, +# which may be empty if the disk type is not supported +# +# Since: 2.2 +## +{ 'type': 'GuestFilesystemInfo', + 'data': {'name': 'str', 'mountpoint': 'str', 'type': 'str', + 'disk': ['GuestDiskAddress']} } + +## +# @guest-get-fsinfo: +# +# Returns: The list of filesystems information mounted in the guest. +# The returned mountpoints may be specified to +# @guest-fsfreeze-freeze-list. +# Network filesystems (such as CIFS and NFS) are not listed. +# +# Since: 2.2 +## +{ 'command': 'guest-get-fsinfo', + 'returns': ['GuestFilesystemInfo'] } |