Skip to content

Commit 8c7b417

Browse files
gabhijitandreeaflorescu
authored andcommitted
documentation: Added returned Error value #119
Changed the documentation of `get_{supported|emulated}_cpuid` to describe returned error. Also, fixed a copy-paster error in he documentation for `get_supported_cpuid` (Example was calling `get_emulated_cpuid`) Signed-off-by: Abhijit Gadgil <[email protected]>
1 parent 87b9c43 commit 8c7b417

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ioctls/system.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ impl Kvm {
258258
/// * `num_entries` - Maximum number of CPUID entries. This function can return less than
259259
/// this when the hardware does not support so many CPUID entries.
260260
///
261+
/// Returns Error `errno::Error(libc::ENOMEM)` when the input `num_entries` is greater than
262+
/// `KVM_MAX_CPUID_ENTRIES`.
263+
///
261264
/// # Example
262265
///
263266
/// ```
@@ -285,6 +288,9 @@ impl Kvm {
285288
/// * `num_entries` - Maximum number of CPUID entries. This function can return less than
286289
/// this when the hardware does not support so many CPUID entries.
287290
///
291+
/// Returns Error `errno::Error(libc::ENOMEM)` when the input `num_entries` is greater than
292+
/// `KVM_MAX_CPUID_ENTRIES`.
293+
///
288294
/// # Example
289295
///
290296
/// ```
@@ -293,7 +299,7 @@ impl Kvm {
293299
/// use kvm_ioctls::Kvm;
294300
///
295301
/// let kvm = Kvm::new().unwrap();
296-
/// let mut cpuid = kvm.get_emulated_cpuid(KVM_MAX_CPUID_ENTRIES).unwrap();
302+
/// let mut cpuid = kvm.get_supported_cpuid(KVM_MAX_CPUID_ENTRIES).unwrap();
297303
/// let cpuid_entries = cpuid.as_mut_slice();
298304
/// assert!(cpuid_entries.len() <= KVM_MAX_CPUID_ENTRIES);
299305
/// ```

0 commit comments

Comments
 (0)