diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-06-29 19:03:37 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-06-29 19:04:21 +0100 |
commit | 152b179a19e43fcb0baec65ea65d394ee1dba891 (patch) | |
tree | 89a2b0057c62d594d77b474cd120cce137497732 /generator | |
parent | cba49169094f04dead9b165b6b5991afa92132ff (diff) | |
download | libguestfs-152b179a19e43fcb0baec65ea65d394ee1dba891.tar.gz libguestfs-152b179a19e43fcb0baec65ea65d394ee1dba891.tar.xz libguestfs-152b179a19e43fcb0baec65ea65d394ee1dba891.zip |
New API: guestfs_nr_devices
This returns the number of whole block devices added. It is usually
simpler to call this than to list the devices and count them, which
is what we do in some places in the current codebase.
Diffstat (limited to 'generator')
-rw-r--r-- | generator/generator_actions.ml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 3c8f5976..e6219d17 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -7340,6 +7340,18 @@ for example as a string returned from C<guestfs_list_devices>. See also C<guestfs_list_devices>, C<guestfs_part_to_dev>."); + ("nr_devices", (RInt "nrdisks", [], []), 336, [], + [InitEmpty, Always, TestOutputInt ( + [["nr_devices"]], 4)], + "return number of whole block devices (disks) added", + "\ +This returns the number of whole block devices that were +added. This is the same as the number of devices that would +be returned if you called C<guestfs_list_devices>. + +To find out the maximum number of devices that could be added, +call C<guestfs_max_disks>."); + ] let all_functions = non_daemon_functions @ daemon_functions |