diff options
| author | Richard W.M. Jones <rjones@redhat.com> | 2012-06-13 22:09:13 +0100 |
|---|---|---|
| committer | Richard W.M. Jones <rjones@redhat.com> | 2012-06-13 23:07:26 +0100 |
| commit | a9d7d044f552855a7ef78d953c0c2672e35bfc80 (patch) | |
| tree | 0cbcca67b484e3c20668383d74af561e065dd409 /generator | |
| parent | 46ed232dc2ff2f7dff91cd93a13d7ce6f2cec504 (diff) | |
| download | libguestfs-a9d7d044f552855a7ef78d953c0c2672e35bfc80.tar.gz libguestfs-a9d7d044f552855a7ef78d953c0c2672e35bfc80.tar.xz libguestfs-a9d7d044f552855a7ef78d953c0c2672e35bfc80.zip | |
New API: device-index.
This returns the index of the device, eg. /dev/sdb => 1.
Or you can think of it as the order that the device was
added, or the index of the device in guestfs_list_devices.
Diffstat (limited to 'generator')
| -rw-r--r-- | generator/generator_actions.ml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 7b2bd97f..f249991e 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -6062,7 +6062,7 @@ removes the partition number, returning the device name The named partition must exist, for example as a string returned from C<guestfs_list_partitions>. -See also C<guestfs_part_to_partnum>."); +See also C<guestfs_part_to_partnum>, C<guestfs_device_index>."); ("upload_offset", (RErr, [FileIn "filename"; Dev_or_Path "remotefilename"; Int64 "offset"], []), 273, [Progress; Cancellable], @@ -7323,6 +7323,19 @@ different operation that turns free space in the filesystem into zeroes. It is valid to call C<guestfs_fstrim> either instead of, or after calling C<guestfs_zero_free_space>."); + ("device_index", (RInt "index", [Device "device"], []), 335, [], + [InitEmpty, Always, TestOutputInt ( + [["device_index"; "/dev/sda"]], 0)], + "convert device to index", + "\ +This function takes a device name (eg. \"/dev/sdb\") and +returns the index of the device in the list of devices. + +Index numbers start from 0. The named device must exist, +for example as a string returned from C<guestfs_list_devices>. + +See also C<guestfs_list_devices>, C<guestfs_part_to_dev>."); + ] let all_functions = non_daemon_functions @ daemon_functions |
