]> git.proxmox.com Git - pve-common.git/commitdiff
SysFSTools: add return format comments
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 23 Nov 2018 13:50:11 +0000 (14:50 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 26 Nov 2018 12:04:56 +0000 (13:04 +0100)
for lspci and get_mdev_types

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/SysFSTools.pm

index 2e7d0284156b8a153e4255c1b85de565a47be17e..2da3a38894268cb33acd2ad3b4414fb16888cb39 100644 (file)
@@ -40,6 +40,28 @@ my $parse_pci_ids = sub {
 #
 # verbose also returns iommu groups, subvendor/device and the
 # human readable names from /usr/share/misc/pci.ids
 #
 # verbose also returns iommu groups, subvendor/device and the
 # human readable names from /usr/share/misc/pci.ids
+#
+# return format:
+# [
+#     {
+#         id => '00:00.0',
+#         vendor => '0xabab',
+#         device => '0xefef',
+#         class => '0x012345',
+#
+#         # optional
+#         iommugroup => '14',
+#         mdev => 1,
+#         vendor_name => 'Foo Inc.',
+#         device_name => 'Bar 9000AF',
+#         subsystem_vendor => '0xacac',
+#         subsystem_device => '0xfefe',
+#         subsystem_vendor_name => 'Foo Europe GmbH',
+#         subsystem_device_name => 'Bar 9001AF OC',
+#     },
+#     ...
+# ]
+#
 sub lspci {
     my ($filter, $verbose) = @_;
 
 sub lspci {
     my ($filter, $verbose) = @_;
 
@@ -112,6 +134,17 @@ sub lspci {
     return $devices;
 }
 
     return $devices;
 }
 
+#
+# return format:
+# [
+#     {
+#         type => 'FooType_1',
+#         description => "a longer description with custom format\nand newlines",
+#         available => 5,
+#     },
+#     ...
+# ]
+#
 sub get_mdev_types {
     my ($id) = @_;
 
 sub get_mdev_types {
     my ($id) = @_;